[Cryptography] generated passphrases

Patrick Chkoreff pc at fexl.com
Mon Aug 12 22:50:00 EDT 2019

jamesd at echeque.com wrote on 8/12/19 6:53 PM:

> I hope someone could direct me to some open source for random phrase
> generation

My code is written in Fexl, but you might find it helpful as pseudocode.

I based my code on this word list:


Here is the module which defines the random_passphrase function:


It has a parameter which is the strength in bits, and it automatically
calculates the correct number of random words to use based on the size
of the word list.  For example if you use a strength of 62 bits, it will
give you a 6-word passphrase.

That module uses a function called random_double, which if you're
interested is defined here:


That streams 7 bytes directly off /dev/urandom and converts them to a
double value.

Finally, here is the word list expressed in Fexl:


-- Patrick

More information about the cryptography mailing list