Skip to content

Instantly share code, notes, and snippets.

@kcollasarundell
Created February 6, 2014 02:09
Show Gist options
  • Save kcollasarundell/8837214 to your computer and use it in GitHub Desktop.
Save kcollasarundell/8837214 to your computer and use it in GitHub Desktop.
Password hashing tool for those of us suffering redhat systems
#!/usr/bin/python
import random
import crypt
import sys
ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
rounds = 25412
password = str(sys.argv[1])
salt = ''.join(random.choice(ALPHABET) for i in range(16))
salt = '$6$rounds='+ str(rounds) + '$' + salt
print crypt.crypt(password, salt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment