问题
I have a server that is not using SSL, so I'm trying to find a way to secure the data being passed to the server. My first thought was jCryption, but it is not exactly what I need. So what I decided is that I could just pre-hash the password and send it to the server for comparison. So my question is, is there a sha1 utility that can be used for password verification purposes with PHP?
回答1:
Try the Stanford Crypto library. It's pretty comprehensive but if you just need a single hashing function you can extract it from the core (it has sha1 and 256).
Refer This
回答2:
You shouldn't be using SHA1 to do your hashing anymore, since it's been broken for a while. Try SHA256.
回答3:
I think that's what you're looking for: http://phpjs.org/functions/sha1:512
来源:https://stackoverflow.com/questions/9610921/one-way-sha1-hash-javascript-implementation