from crypt import crypt
pw = '2600'
htpasswd = 'Jywn1PBEdYjkg'
authd = crypt(pw,htpasswd)==htpasswd
assert authd
authd = crypt('wrongpw',htpasswd)==htpasswd
assert authd==False
Showing posts with label authentication. Show all posts
Showing posts with label authentication. Show all posts
Saturday, September 11, 2010
python crypt authenticate htpasswd/htdigest
A python snippet to authenticate against a htpasswd hash in Python:
Subscribe to:
Posts (Atom)