[PYTHON-CRYPTO] First draft of secret-key encryption PEP

Bram Cohen bram at GAWTH.COM
Sat Sep 29 00:33:48 CEST 2001


On Fri, 28 Sep 2001, Andrew Kuchling wrote:

> On Wed, Sep 19, 2001 at 12:42:23AM -0700, Bram Cohen wrote:
> >For what it's worth, my project uses rijndael in counter mode, which you
> >don't have included, and the API is that you call make_encrypter() and it
> >returns a function, which you call repeatedly passing different strings
> >and it encrypts them in order (it's not threadsafe). Decryption is done
>
> Where can I find a description of counter mode?  Should it be added as
> one of the required feedback modes?

Counter mode is where you take a encrypt 0, 1, 2, etc. with the key and
xor the resulting blocks with plaintext to get the ciphertext. Decryption
is done in the same way. It has big-endian and little-endian variants,
depending on how you translate the counter into a block. The main API
wrinkle is whether you want to allow the counter to be initially set to
something other than 0.

Counter mode isn't discussed much in the literature, mostly because it's
security properties are obvious enough that there isn't much interesting
to say about them (this is a good thing). It's a strict improvement on OFB
- random access is allowed, and there isn't a short cycle problem.

I'm in favor of it being supported, since I'm using it, and would like to
get my app back to being pure python again :-)

-Bram Cohen

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





More information about the python-crypto mailing list