(GNU MP) Blum, Blum, & Shub
Cryptographically Secure PRNG

GMPBBS (version 0.08d)

source: (tbz2) (zip) (browsable)
windows (command line) binaries reside (here)
older versions are here
there's also a smaller example i wrote up here.

installation on GNU/Linux:
    $ make
    $ make install
    $ gmpbbs --help

usage: gmpbbs [-h] [-o outfile] [-b base] [-k key_bitlen]
       [-p prime] [-q prime] [-x initial] <# of randoms>

   -h, --help : this help message
   -o, --output : file to write output to
   -b, --base : number base to use for output
   -k, --keylen : requested key length (k>=16) (default 1024)
   -s, --slow : don't use the improved (fast) algorithm
   -X, --xor : XOR output with operating system's pseudo-random output
   -p : prime p = 3 (mod 4)
   -q : prime q = 3 (mod 4)
   -x : initial x (to generate x0) (gcd(pq,x)=1)
   # of randoms : the number of random integers to generate

create a random WEP encryption key (in hex):
$ gmpbbs -b 16 13

output 1M random bytes to the file "rbytes":
$ gmpbbs -o rbytes 1048576

get 8 random numbers in the range [0-23], using a key of 64 bits:
$ gmpbbs -k 64 -b 24 8

java class BlumBlumShub (version 0.03)

java source: (tbz2) (zip) (browsable)

this is a (much slower) java implementation compatable with gmpbbs
(same output, if someone wished to write cross-platform encryption code)

Firefox plugin RandPass (version 0.03)

source: (tbz2) (zip) (browsable)

Firefox plugin to create random passwords (accessible via tools menu or right mouse)
see INSTALL for instructions on building it.

igo - a GNU Guile wrapper using the code from gmpbbs (version 0.10)
(requires guile-cvs)

source: (tbz2) (browsable)
older versions are here

(use-modules (igo blumblumshub))
(define bbs (make-blumblumshub))

;; generate a 2048 bit key seeded from
;; /dev/urandom
(bbs 'generate-random-key 2048)

;; generate a seed using /dev/urandom
(bbs 'generate-random-seed)

;; set to the improved algorithm
;; (keep loglog n bits)
(bbs 'set-improved! #t)

;; generate 8192 random characters as a list
(bbs 'random-chars 8192)

;; generate 11 integers in the range [0-76]
(bbs 'random-integers 11 77)

;; 81 dice rolls
(map + (bbs 'random-integers 81 6) (make-list 81 1))


* documentation!

* add support for storing/recalling keys (via ~/.gmpbbs/ and save/restore switches)

GMPBBS started out as part of a school project with number theory.
here is my paper in postscript, pdf and the texmacs source.