Skip to content

Instantly share code, notes, and snippets.

@n0ts
Created February 7, 2014 07:22
Show Gist options
  • Save n0ts/8858542 to your computer and use it in GitHub Desktop.
Save n0ts/8858542 to your computer and use it in GitHub Desktop.
Generate password
from crypt import crypt
from random import choice
import string
import sys
salt_pop = string.letters + string.digits + '.' + '/'
salt = ''
for i in range(8):
salt = salt + choice(salt_pop)
salt = '$1$' + salt
encpass = crypt(sys.argv[1], salt)
print encpass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment