Jump to content

CRYPT_SHA512 is generating same hash value for multiple inputs

Go to solution Solved by requinix,

Recommended Posts



I see that when I am applying crypt function on the text 'samurai.ciscorouter1', output is same as it is for 'samurai.ciscorouter2'. Is the code I am giving how it must be?

print "<hr/>" .crypt(crypt(crypt('samurai.ciscorouter1',CRYPT_SHA512), CRYPT_SHA512), 

print "<hr/>" .crypt(crypt(crypt('samurai.ciscorouter2',CRYPT_SHA512), CRYPT_SHA512), 
Link to comment
Share on other sites

  • Solution

You're not using crypt() correctly. The second argument is not a "mode". You don't pass in constants like CRYPT_SHA512. In fact those constants only tell you whether there is support for that type of hash.



print "<hr/>" . crypt('samurai.ciscorouter1', '$6$a16charactersalt');
print "<hr/>" . crypt('samurai.ciscorouter2', '$6$a16charactersalt');
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.