Created
January 27, 2016 02:06
-
-
Save ryantuck/cdde56c63d84d39b36d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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