Created
March 14, 2012 22:21
-
-
Save ties/2040015 to your computer and use it in GitHub Desktop.
random passphrase generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Generate random word list from Linux Dictionary | |
# | |
# Based on script seen at CCC talk 4494 <http://ftp.ccc.de/events/camp2011/video/cccamp11-4494-laptop_and_electronics_searches_at_the_us_border-en.mp4> at 25:30 | |
# (c) Electronic Fronteer Foundation (it's from the presentation) | |
import random, math | |
d = open('/usr/share/dict/words').readlines() | |
n = 5 | |
print ' '.join(random.choice(d).rstrip() for i in range(n)) | |
print n * math.log(len(d))/math.log(2), 'bits' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment