Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hy friend's

i have a problem in SHA_512 algo. how can i differ a user password from another user.
mean's when a user "jon" enter a password "like" the the hash 512 hash it into something like this"4ssf5789sd543s" and another user "aslam" have the same password then it mean's they both have same hashe's
how can i differ it from one another.
using "salt" individually? if yes the how ?


THANK"S .
Posted
Updated 24-May-13 19:15pm
v2
Comments
Sergey Alexandrovich Kryukov 25-May-13 1:49am    
So what? What would be the scenario when something needs to "differ" one from another? If you think about it, you will see that there is no such thing.
—SA

1 solution

Please see my comment to the question.

Yes, but this is not a problem, because the server part stores password cache values indexed by user names. Jon and Aslam do not know that their passwords are identical unless one tried to log in representing another one with own password. Also it's important that no one would be able to find out any of original passwords (more exactly, this is what called "infeasible" in cryptography), even having the access to the storage of user names and password cache.

—SA
 
Share this answer
 
Comments
msz900 25-May-13 2:44am    
how can i add salt.. i try like this

hash($_POST['pass'],"salt")

and it work's.
is it th true process?
Sergey Alexandrovich Kryukov 25-May-13 19:26pm    
No, first parameter is algorithm, followed by data and then optional Bool:
http://php.net/manual/en/function.hash.php

I never tried it, but you can check with documentation:
http://www.google.com/url?sa=t&rct=j&q=PHP+hash&source=web&cd=2&cad=rja&ved=0CDQQFjAB&url=http%3A%2F%2Fphp.net%2Fmanual%2Fen%2Fbook.hash.php&ei=jkihUYudN9TG4APb64DABA&usg=AFQjCNF9gbGQI6lH4lLHuEa250lk4USxrA

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900