Skip to content

Instantly share code, notes, and snippets.

@44670
Last active November 2, 2019 08: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 44670/a4e5c2094b6d900fa28b84acb2dd83ef to your computer and use it in GitHub Desktop.
Save 44670/a4e5c2094b6d900fa28b84acb2dd83ef to your computer and use it in GitHub Desktop.
import getpass
import base64
from hashlib import pbkdf2_hmac
pwd = getpass.getpass()
salt = raw_input('Salt:')
iters = 10000
hmac = pbkdf2_hmac(hash_name='sha256',password=pwd,salt=salt,iterations=iters)
pwd = base64.b64encode(hmac)
print(pwd)
print(pwd[:16])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment