Created
January 29, 2019 17:15
-
-
Save lucashalbert/0e72265fca297329d7c39fa0fcf8179b to your computer and use it in GitHub Desktop.
Script to generate a salted sha512 hash
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/python | |
import sys; | |
import getpass; | |
import crypt; | |
import uuid; | |
password = getpass.getpass("New Password: "); | |
salt = uuid.uuid4().hex [0:8]; | |
#print("Pass:",password); | |
#print("Salt:",salt); | |
hash=crypt.crypt(password, "$6$"+salt+"$"); | |
if len(sys.argv) > 1: | |
username = sys.argv[1] | |
print(username+": {CRYPT}"+hash); | |
else: | |
print("{CRYPT}"+hash); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment