SHA-based encryption function in Python

Paul Rubin phr-n2002a at nightsong.com
Wed Apr 24 09:20:34 EDT 2002


"A.M. Kuchling" <akuchlin at ute.mems-exchange.org> writes:
> > Although, HMAC in Python using string multiplication instead of loops
> > might not be so slow.  I'll see if I can code it that way.
> 
> Note that Python 2.2's standard library includes an hmac module.

Yes, but this encryption module is supposed to work in 1.5.2.

Also, the 2.2 hmac module is written in python and looks pretty slow.

I should re-read Krawczyk's HMAC paper to see what that fancy padding
is really supposed to do.  Remember that the underlying encryption
here (SHA-OFB) probably isn't the greatest in the world either.

And it actually might be faster to use two separate hash-based auth
keys than deal with the fancy HMAC padding, if a simple double hash
has some vulnerabilities.



More information about the Python-list mailing list