Encrypting much data with AES and M2Crypto
Heiko Wundram
heikowu at ceosg.de
Sat May 31 09:38:04 EDT 2003
Quoting Jason Smith <jason_nospam at oes.co.th>:
> But, since I will be feeding the CipherStream many gigabytes, I need to
> prevent this behavior, until of course I encrypt the last part of the hard
> drive image.
Use PyCrypto. PyCrypto contains "bare" support for several Cipher algorithms,
including AES, and these are all implemented as stream objects (stream meaning
that you can just use the encrypt method of the instantiated object over and
over, without the need to put it in all at once, what seems to be the problem you
are facing at the moment). Remember that AES has a fixed block size (8 bytes),
so your input must be a multiple of this, so it might actually be more clever to use
a true stream cipher (which has variable input length), e.g. ARC4.
PyCrypto also doesn't rely on the OpenSSL libs, so that's one more major plus (at
least for me).
If you're interested, you can wait for tonight's snapshot of yawPyCrypto, which I'll
be releasing some time later; yawPyCrypto contains wrapper code for all PyCrypto
cipher objects which lets you concentrate on what you want: a cipher stream,
rather than worrying about block-sizes, etc.
See my earlier post to get the necessary liks.
HTH!
--
Heiko Wundram
Universität 18 - Zimmer 2206
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
More information about the Python-list
mailing list