[PYTHON-CRYPTO] need counter mode implementation

Bram Cohen bram at GAWTH.COM
Fri Jun 22 23:10:23 CEST 2001


I've now finished the encryption part of an application I'm writing, and
the crypto is slow (unsurprising, since it's in pure python.) I've got it
set up to try to import a C version and only use the pure python version
if there's an ImportError (I love Python).

I'm wondering if anyone could throw together a pure C version of the
following together quickly -

A module named _StreamEncrypter has a function called make_encrypter.
make_encrypter takes a 128 bit rijndael key and returns a callable which
encrypts strings it's passed in big endian counter mode. So, if you pass
it the same string twice, it will return two different values because it
xored with different encrypted blocks, and decrypting is done using the
same function as encrypting.

I prefer an implementation which is public domain. Anyone sending me one
gets their name in the credits :)

-Bram Cohen

"Markets can remain irrational longer than you can remain solvent"
                                        -- John Maynard Keynes





More information about the python-crypto mailing list