Comment 2 for bug 1014715

Revision history for this message
Darsey Litzenberger (dlitz) wrote :

I agree that using CBC as described here is inappropriate. (Seriously, CBC mode is very fragile. You should not use it for anything except encrypting entire plaintexts at once with a random IV. If you want to muck about with fancy use cases, use something like CTR mode or XTS mode.)

That said, I think PyCrypto should have an API for reinitializing a block cipher with a new IV without necessarily running the key-scheduling algorithm again (especially for ciphers like Blowfish, which have a slow KSA), although I'm not sure what this API should look like. It's great to *say* that people should use XTS mode, but PyCrypto doesn't currently support XTS mode, ESSIV mode, or any of the fancy modes of operation used for disk encryption. Having some way to manipulate the IV from Python code would make it easier for researchers to implement some of these extra modes of operation in Python code.

PyCrypto has historically been useful as a tool that allowed crypto researchers to experiment with, and I'd like us to retain that ability where it makes sense.