Skip to content

Instantly share code, notes, and snippets.

@ryantuck
Created January 27, 2016 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryantuck/cdde56c63d84d39b36d0 to your computer and use it in GitHub Desktop.
Save ryantuck/cdde56c63d84d39b36d0 to your computer and use it in GitHub Desktop.
from passlib.hash import pbkdf2_sha256
import time
passwd = 'asdf'
for x in range(0,20):
r = pow(2,x)
t0 = time.time()
h = pbkdf2_sha256.encrypt(passwd, rounds=r, salt_size=16)
t1 = time.time()
print 'time: %f | rounds: %i' % (t1 - t0, r)
h = pbkdf2_sha256.encrypt(passwd, rounds=100, salt_size=16)
print h
print pbkdf2_sha256.verify(passwd,h)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment