Messages in this thread | | | Date | Tue, 16 Nov 1999 11:46:13 -0600 | From | Tim Walberg <> | Subject | Re: slightly OT::shadow file.. |
| |
On 11/16/1999 12:04 -0500, Arni Raghu wrote: >> Hi folks, >> This is slightly OT but I thought only u kernel folks can answer this >> better:: >> >> Hi, >> I am just playing with the shadow file (after making copies :) and teh crypt >> command.. >> >> Here is a simple sequence that I perform..:: >> >> useradd testme >> passwd testme :: (passwd entered is testme2) >> >> then look into the shadow file and see:: >> >> testme:$1$hI.ost8u$XZNxiISsD2ZuOrb6/Td3a/:10910:0:99999:7:-1:-1:134537888 >> >> then using a simple perl script..I do $passwd = crypyt("testme2","$1"); >> >> But the passwd I get is not the same as the one encoded in teh shadow >> file... >> >> what is going on..I thought using the passwd and the salt I should be >> getting back to the same encrypted passwd..why is this happening.. >> >> something silly..??? >>
It's been a while since I've looked at this, but IIRC, the salt in this case should be "$1$hI.ost8u$", not "$1"... the "$1$" identifies to the crypt function to use the MD5 algorithm, rather than the DES variant, the "hI.ost8u" portion is the actual salt, followed by another "$" terminator. Using a salt string that does not start with "$1$" results in the legacy DES variant crypt functionality.
I may not have gotten that all right, but it should give you someplace to start - peruse the libc source for more details...
tw
-- +------------------------------+--------------------------+ | Tim Walberg | Phone: 847-782-2472 | | TERAbridge Technologies Corp | FAX: 847-623-1717 | | 1375 Tri-State Parkway | twalberg@terabridge.com | | Gurnee, IL 60031 | 800-SKY-TEL2 PIN 9353299 | +------------------------------+--------------------------+ [unhandled content-type:application/pgp-signature] | |