If I create an md5 hash for a string on one cpmputer using a bash script, will that same string create the same md5 hash if I were to cerate an md5 hash via a php script on another computer? I'm trying to write a script on one computer and port it to another. That script will create an md5 hash for a user password. Then, a seperate web page will ask for a username and password. As I do not want to store the raw password I'd like to store the hash, have the php script compute the hash for the password that the user enters, and grant access if they match up. Should this theoretically work, or are there issues that I need to consider?
3条回答 默认 最新
- douzhuoxia0587 2012-01-24 17:33关注
Yes, MD5 checksums are platform agnostic and will produce the same value every time on the same file/string/whatever.
However, you may want to reconsider your scheme. At least salt your hashes. There is tons of advice for username/password storage schemes on StackOverflow.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报