Skip to content

Instantly share code, notes, and snippets.

@44670
Created February 18, 2021 02:14
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/41f4eab92ac28d9eb20f95f343589d2c to your computer and use it in GitHub Desktop.
Save 44670/41f4eab92ac28d9eb20f95f343589d2c to your computer and use it in GitHub Desktop.
genpass.py
import getpass
import base64
from hashlib import pbkdf2_hmac
pwd = getpass.getpass()
salt = input('Website Name:')
iters = 10000
hmac = pbkdf2_hmac(hash_name='sha256',password=pwd.encode('utf8'),salt=salt.encode('utf8'),iterations=iters)
pwd = base64.b64encode(hmac).decode('utf8')
print(pwd)
print(pwd[:16] + '!1')
input('Goodbye.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment