Comment 2 for bug 241117

Revision history for this message
Ryan Kelly (rfkelly) wrote :

I've wanted a similar functionality myself in the past, but mostly to re-run a decryption rather than an encryption as in this example. I have a library for transparently accessing encrypted files as a file-like objects, that allows random access by resetting the cipher whenever seek() is called.

In this case I simply keep a copy of the original IV, and reset the cipher object by assigning this to its "IV" property; this seems to work correctly but I suspect that's an accident, and the block-cipher PEP specifically forbids setting the IV property.