Skip to content

Instantly share code, notes, and snippets.

@bitexploder
Created April 2, 2013 16:23
Show Gist options
  • Save bitexploder/5293595 to your computer and use it in GitHub Desktop.
Save bitexploder/5293595 to your computer and use it in GitHub Desktop.
import Crypto.Random.random as pycryptrand
import sys
def random_line(afile):
line = next(afile)
for num, aline in enumerate(afile):
if pycryptrand.randrange(num + 2):
continue
line = aline
return line
f = open("wordlist", "r")
lines = f.readlines()
password = ""
for i in range(0, int(sys.argv[1])):
password += pycryptrand.choice(lines)
password = password.replace("\n", " ")
password = password.replace("\r", "")
password = password.lower()
print password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment