[pycrypto] Public Key encryption of files
dave.pawson at gmail.com
Fri Nov 11 08:33:56 CST 2011
On 11 November 2011 13:21, Dean Macinskas <dmacinskas at geobridge.net> wrote:
> For what you're doing the example is fine, but I think you'd be disappointed in the performance if your file was 10mb instead of 1 kb. Why? Because CFB-8 requires an AES cycle *PER BYTE*. So encrypting 1024 bytes requires 1024 AES cycles, compared to 64 if you used CBC.
Could you tell me how to change the code please, to use the less extravagent ???
whatever CBC is?
def encrypt(plaintext, secret, lazy=True, checksum=True):
encobj = AES.new(secret, AES.MODE_CFB)
plaintext += struct.pack("i", zlib.crc32(plaintext))
Is it the change to the first line above? If so, how to specify CBC please?
XSLT XSL-FO FAQ.
More information about the pycrypto