[WF-Infra] CVS

John R. Sheets dusk at ravendusk.org
Sat Mar 3 09:57:20 PST 2001


On Feb 25, 2001, Tommi Laukkanen <tommi.laukkanen at hut.fi> wrote:
> 
> How do I encrypt the password?

Try something like this:

----------
#!/usr/bin/perl -w
$passwd = crypt ("mypassword", "salt");
print "$passwd\n";
----------

Hack in your password and salt.  The salt is just some meaningless
string of characters to give the encryption some bite, IIRC.  Often,
people will salt their password with their user name.  crypt() will
tack the first two characters of the salt onto the front of the
encrypted string (the GNOME project encourages this).  For example,
crypt ("mypassword", "jsheets") gives an encrypted string of
"jsuPtF2jlovDY".

I'm just passing on what other people have told me, so take this with
a -- erhum -- grain of salt.  If you have doubts, you can always try
pasting the generated encrypted string into some account in your
/etc/passwd file and try to log in with that password.  (c;

John

-- 
dusk at ravendusk.org                            http://www.gnome.org
jsheets at codeweavers.com                  http://www.worldforge.org
jsheets at users.sourceforge.net     http://openbooks.sourceforge.net
               http://advogato.org/person/jsheets

                   Writing GNOME Applications
          http://www.aw.com/cseng/titles/0-201-65791-0/




More information about the Infra mailing list