[erlang-questions] Password generator in Erlang

Artem Teslenko <>
Thu Aug 16 16:53:01 CEST 2012


One more way to generate the passwords:

random:seed(now()).
base64:encode_to_string(crypto:rand_bytes(16)).

"EbvUy9ZHTqoAOvMSZ53X5A=="

After that just remove the unnecessary characters.

On Thu, 16 Aug 2012, Raimo Niskanen wrote:

> On Wed, Aug 15, 2012 at 11:42:06AM +1200, Richard O'Keefe wrote:
> > 
> > On 15/08/2012, at 4:44 AM, Loïc Hoguin wrote:
> > 
> > > On 08/14/2012 06:09 PM, Zabrane Mickael wrote:
> > >> 
> > >> On Aug 14, 2012, at 5:40 PM, Loïc Hoguin wrote:
> > >> 
> > >>> os:cmd("pwgen | cut -c 1-8").
> > >> 
> > >> a portable one ;-)
> > > 
> > > I believe pwgen and cut are available on all of win/linux/bsd/osx.
> > 
> > m% man pwgen
> > No manual entry for pwgen
> > 
> > Mac OS X 10.6.8.
> > 
> > v% man pwgen
> > No manual entry for pwgen
> > 
> > Linux 2.6.31.5-127.fc12.x86_64
> > 
> > f% man pwgen
> > No manual entry for pwgen.
> > 
> > Solaris.
> > 
> > Available?  May be, I don't know.
> > Installed?  NO.
> 
> And the same applies to Ubuntu, FreeBSD and OpenBSD...
> 
> This might be more portable:
>   openssl rand -base64 6 | tr +/ .,
> 
> > 
> > 
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://erlang.org/mailman/listinfo/erlang-questions
> 
> -- 
> 
> / Raimo Niskanen, Erlang/OTP, Ericsson AB
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list