Created
January 10, 2013 08:02
-
-
Save evandrix/4500317 to your computer and use it in GitHub Desktop.
Password Management @ http://software-and-algorithms.blogspot.sg/2012/06/password-management.html
This file contains hidden or 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
# Kevin L. Stern, June 2012. | |
from hashlib import sha256 | |
from hmac import new as hmac | |
from getpass import getpass | |
from base64 import b64encode | |
master = getpass('Enter your master password: ') | |
account = raw_input('Enter the account name: ') | |
iterations = 100000 | |
secret = sha256(master + account + str(iterations)).digest() | |
for j in xrange(iterations-1): | |
secret = sha256(master + secret).digest() | |
print b64encode(hmac(secret, account, sha256).digest()) | |
raw_input('Press [Enter] to continue.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment