一种方式 SHA1 哈希 javascript 实现?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9610921/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
one way SHA1 hash javascript implementation?
提问by nkcmr
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?
我有一台未使用 SSL 的服务器,因此我试图找到一种方法来保护传递到服务器的数据。我的第一个想法是jCryption,但这并不是我所需要的。所以我决定我可以预先对密码进行散列并将其发送到服务器进行比较。所以我的问题是,是否有一个 sha1 实用程序可用于 PHP 密码验证?
回答by leebriggs
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).
试试斯坦福加密图书馆。它非常全面,但如果您只需要一个散列函数,您可以从核心中提取它(它有 sha1 和 256)。
回答by Oleksi
You shouldn't be using SHA1 to do your hashing anymore, since it's been broken for a while. Try SHA256.
您不应该再使用 SHA1 进行散列,因为它已经损坏了一段时间。尝试 SHA256。
回答by Vadim Baryshev
I think that's what you're looking for: http://phpjs.org/functions/sha1:512
我认为这就是你要找的:http: //phpjs.org/functions/sha1: 512