The (English version of) pwgen has been translated to Javascript: http://8-p.info/pwgen/pwgen.js It isn't very long. In fact it's a pretty simple algorithm. [Waving hands vigorously] It just threads a random path through a finite state automaton. Translating it to Erlang should be easy for anyone who wants to.