Skip to content

Instantly share code, notes, and snippets.

@zachreizner
Created March 31, 2020 00:20
Show Gist options
  • Save zachreizner/dedb83b6207b9cf15feadde993f78586 to your computer and use it in GitHub Desktop.
Save zachreizner/dedb83b6207b9cf15feadde993f78586 to your computer and use it in GitHub Desktop.
# License: Public Domain
import base64
import hashlib
import random
import string
import sys
salt = ''.join(random.choices(string.ascii_uppercase + string.ascii_lowercase +
string.digits, k = 16)).encode()
hashed = salt + sys.argv[1].encode()
for i in range(1000):
m = hashlib.sha512()
m.update(hashed)
hashed = m.digest()
salted = salt + base64.b64encode(hashed)
print(salted.decode())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment