Securing 'pickle'

Dave Cole djc at object-craft.com.au
Fri Jul 11 01:19:35 EDT 2003


>>>>> "Paul" == Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:

Paul> Ian Bicking <ianb at colorstudy.com> writes:
>> A much easier way to secure your pickle is to sign it, like:
>> 
>> cookie = dumps(object) secret = 'really secret!'  hasher =
>> md5.new() hasher.update(secret) hasher.update(cookie)
>> cookie_signature = md5.digest()

Paul> That method is vulnerable to an "appending" attack against md5.
Paul> I'll spare the gory details, but you should call md5 through the
Paul> HMAC module to make the signature instead of using md5 directly.
Paul> HMAC is designed to stop that attack.

I have been googling for information on the "appending" attack against
md5 and cannot find anything that clearly describes it.  Do you have
any links handy?

- Dave

-- 
http://www.object-craft.com.au




More information about the Python-list mailing list