cowboy me, 2.0: jose nazario beauty and the street


passphrase generator



inspired by xkcd 936 on password generators, i wrote a simple passphrase generator in python. you can see it below.
#!/usr/bin/env python

import random import sys

try: passlen = int(sys.argv[1]) except IndexError: passlen = 4 # default to 4

r = random.Random() words = [ x.strip() for x in open('/usr/share/dict/words', 'r').readlines() ] for x in xrange(passlen): print r.choice(words), print


usage is simple: just specify how long you want the passphrase to be. if you want klingon, spanish, etc you can alter the list of words.

some examples:
Dix:bin jose$ ./passphrase 
Euplocomi Protomycetales hypodermal reissuer
Dix:bin jose$ ./passphrase 
hidromancy precompounding reascertainment gnomical
Dix:bin jose$ ./passphrase 6
orthographize sicknessproof velvetbreast holocephalian hypochlorhydric harshly


hope this is useful to someone.

|

----

next Saturday, Dec 17, 2011 @ 08:42am | previous Friday, Apr 16, 2010 @ 02:35pm | archives

Last modified: Saturday, Aug 27, 2011 @ 09:01am
Weblog Commenting and Trackback by HaloScan.com

Your Ad Here

copyright © 2002-2014 jose nazario, all rights reserved.