[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:

https://www.eff.org/files/2016/09/08/eff_short_wordlist_1.txt


Here is the module which defines the random_passphrase function:

https://fexl.com/snippet/passphrase.fxl

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:

https://fexl.com/snippet/random_double.fxl

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


Finally, here is the word list expressed in Fexl:

https://fexl.com/snippet/word_list.fxl



-- Patrick


More information about the cryptography mailing list