Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Authentication with /etc/shadow

by JavaFan (Canon)
on Feb 26, 2011 at 18:44 UTC ( #890331=note: print w/replies, xml ) Need Help??

in reply to Authentication with /etc/shadow

You said, you have changed the hash. Perhaps the hash started with $1$? Because the GNU libraries have two ways of encrypting passwords: traditional DES using a 2 character seed, or an MD5 based encryption that uses a key of the form '$1$...$', where '...' is up to 8 characters.

See also your systems crypt manual page.

Replies are listed 'Best First'.
Re^2: Authentication with /etc/shadow
by fluffyvoidwarrior (Monk) on Feb 26, 2011 at 19:21 UTC
    Yes, thanks.

    I chopped the first 2 chars off to use as the salt but, as you said, the hash actually started $6$ with a $ delimiter at the 8th char.

    so this must be the MD5 format

    The start of the hash is "$6$ENtbbZ8/$" so the $salt would be "ENtbbZ8/" ? ...
    and then my little code snippet might work?

    Will check out the crypt manpage Thank you.
      so this must be the MD5 format

      I believe that would be SHA512, the passwords start with $6$ -- Crypt::Password can handle it, I think.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://890331]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-07-18 17:05 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (393 votes). Check out past polls.