[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Password encrypting



On Wed, 30 May 2001, Robert Magier wrote:

> Values of encrypted passwords are diffrent each time I use makepasswd. 
> So, how the login program check my  password?
> I tested if I can login to the system for each of this values ( I write it
> down to the /etc/shadow )  and I could.

The crypt() function takes a "salt" value:

char *crypt(const char *key, const char *salt);

The "salt" is some random value that is used in the encryption 
algorithm, two-characters chosen from the set [a-zA-Z0-9./].  These
two characters are then stored as the first two characters of the crypted
password.  That way, when you log in, the password you type along with the
first two characters of the crypted password is handed to crypt().  If the
resulting string is the same as the stored encrypted password, you are
allowed to log in.

regards,
Izak
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Izak Burger (iburger@cs.sun.ac.za)
http://www.cs.sun.ac.za/
Tel. +27 21 808 4863
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
A big enough hammer can usually fix anything.



Reply to: