Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: password encryption woes

by zentara (Archbishop)
on May 11, 2017 at 16:51 UTC ( [id://1190081]=note: print w/replies, xml ) Need Help??


in reply to password encryption woes

Hi, I'm just curious about your approach to the problem. From the first example hash, the $1$ indicates an MD5 hash, but there is no third $ to indicate where the salt ends. So why in your code do you assume the salt is everything up to the = sign?

I'm not really a human, but I play one on earth. ..... an animated JAPH

Replies are listed 'Best First'.
Re^2: password encryption woes
by rdfield (Priest) on May 11, 2017 at 17:36 UTC

    Looking at the data, the first part after the $1$ is in base64, and the rest of it is in hex. The amount of data in the hex string matches the size of an SHA512 digest.

    I have a number of examples of the same password being hashed with this function, and the size of the base64 part is always the same, but the value is different. When decoded, the string is exactly 32 bytes long.

    I have made the assumption that some random(?) data is being passed to an MD5 function, as this outputs 32 bytes. The $1$ would indicate, I think, that an md5 crypt function is being used to generate the salt, rather than md5 itself.

    Following on from this, my assumption is that this function used to return an MD5 hashed password, and has subsequently been upgraded to SHA512, but for whatever reason they didn't change the algorithm number, and didn't use the standard crypt(3) library.

    rdfield

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1190081]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found