Le 13 janvier 2007 à 14:41, Felipe C. a écrit :
I’m coding a “postfixadmin” using ruby, so, all the passwords are stored
in DB using a bsd like md5 hash. Is there any simple way I could
generate passwords like that (the same hash could be used to generate
If that’s really a BSD-like password (in the form $n$aaaaaaa$aa…), the
crypt function should be able to generate it on a unix system, as long
as you pass the entire salt ($ included) :
If you take a look at the manpage of the crypt system function (man 3
crypt or http://www.freebsd.org/cgi/man.cgi?query=crypt&sektion=3 ),
you’ll see an explanation of the hash format.
I have no idea of the portability of that function, though. For
instance, it doesn’t work on my Windows box, but it works well enough
with FreeBSD and Linux.