Skip to content

Instantly share code, notes, and snippets.

@orip
Created September 22, 2010 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orip/591266 to your computer and use it in GitHub Desktop.
Save orip/591266 to your computer and use it in GitHub Desktop.
# one-liner for generating a 14-char password
# On Windows this is a secure password, based on CryptGenRandom
# On *nix this is based on /dev/urandom which is intended to be a cryptographically-secure PRNG but
# usually isn't. It should still be good enough for passwords.
python -c "import random, string; r = random.SystemRandom(); print ''.join(r.choice(string.letters + string.digits) for i in xrange(14))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment