You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CBC encryption feeding example in the README currently reads something like:
encrypter=pyaes.Encrypter(pyaes.AESModeOfOperationCBC(key, iv))
ciphertext=encrypter.feed(plaintext)
# Make a final call to flush any remaining bytes and add paddinciphertext+=encrypter.feed()
If you pass in an empty string as the plaintext, this results in:
.../.venv/lib/python2.7/site-packages/pyaes/blockfeeder.pyc in feed(self, data)
163
164 if self._buffer is None:
--> 165 raise ValueError('already finished feeder')
166
167 # Finalize; process the spare bytes we were keeping
ValueError: already finished feeder
This could be made ever so slightly more reliable by changing this line to:
ifdataisNone:
This would make it easier to have a generic encrypt_aes function taking an arbitrary string, without having to handle an empty string as a special case.
Does that seem like a sensible approach?
The text was updated successfully, but these errors were encountered:
Sorry this has taken so long to get to. I will add a test case this weekend for that case (to reproduce the issue), make that change, and get it updated.
The CBC encryption feeding example in the
README
currently reads something like:If you pass in an empty string as the plaintext, this results in:
This could be made ever so slightly more reliable by changing this line to:
This would make it easier to have a generic
encrypt_aes
function taking an arbitrary string, without having to handle an empty string as a special case.Does that seem like a sensible approach?
The text was updated successfully, but these errors were encountered: