Last active
April 26, 2017 13:24
-
-
Save bl00m/b2374e89d0657353ebb591733bee2066 to your computer and use it in GitHub Desktop.
Use scrypt to derive a password in a 24 chars string in base64
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
#!/usr/bin/env python | |
# Usage : pwgen.py [salt] | |
import scrypt | |
import getpass | |
import base64 | |
import pyperclip | |
import time | |
import sys | |
salt = sys.argv[1] if len(sys.argv) > 1 else 'pdojoe44z67dhiahabdiz' # Change the default salt | |
pwd = getpass.getpass() | |
pyperclip.copy(str(base64.b64encode(scrypt.hash(pwd, salt)[:24]))[2:-1]) | |
print('Clear clipboard in 10sec...') | |
time.sleep(10) | |
pyperclip.copy('') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment