Old MySQL Password Hash
A python implementation of the old MySQL PASSWORD() function. This is insecure. There is a reason MySQL changed this in version 4.1. Use it only if you have to!
- mysql
- password
- hash
- old
- insecure
A python implementation of the old MySQL PASSWORD() function. This is insecure. There is a reason MySQL changed this in version 4.1. Use it only if you have to!
At the [Internet Identity Workshop](http://iiw.idcommons.net/Iiw8) in May, 2009, I spoke to Alan Karp and Tyler Close of HP Labs about their research on authorization without identity. Here are my [Delicious links](http://delicious.com/sbwms/ZBAC) on the subject. This led me to write code to generate a "web-key," the shared secret needed to implement the access control method discussed. In his paper, Tyler Close recommends 70 bits for the shared secret, encoded as a 13-character Base32 string. I used 72 bits, so the secret is a 12-character, URL-safe Base64 string without padding characters. I'm new to Python and Django, so I welcome refinements!
This functions encodes a password in the same format as django. You can set the auth_user.password column with the result of this function: update `auth_user`.`password` set `password` = django_password('secret') where id = 1234;