是否有适用于 jQuery 1.3.2 的有效 md5 插件或等效加密插件?
我将密码存储在服务器上,并且只使用 HTML/JavaScript,我需要能够获取输入密码、计算哈希值,然后通过 Ajax 与数据库中的内容进行比较。
由于我使用的是 CouchDB,因此实际上没有服务器代码,而这正是我通常进行此类计算的地方。
任何一种单一方式的加密都可以工作。我看到一个旧插件似乎不受 jQuery 早期版本的支持。根据我的经验,1.3 和 1.2 似乎大多不兼容,我想知道对于最新版本的 jQuery,甚至只是普通的旧 JavaScript,是否有任何新的解决方案来解决这个问题。
谢谢!
I'm storing my passwords on a server, and, using nothing but HTML/JavaScript, I need to be able to take an input password, compute the hash, then compare against what's in my database via Ajax.
As I'm using CouchDB, there's actually no server code, which is where I'd normally do such a calculation.
Any kind of one way encryption would work. I saw an old plugin that appears unsupported for an earlier version of jQuery. As 1.3 and 1.2 seem to be mostly incompatible from my experience, I wonder if there's any new solution to this problem for the latest version of jQuery, or even just plain old JavaScript.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您为什么要寻找 jQuery 插件? JavaScript 中有多种 MD5 和 SHA1 实现,可以将任何字符串转换为哈希字符串,并且可以轻松地与 jQuery 一起使用。
以下是“JavaScript sha1”的第一个 Google 结果:
http://www.webtoolkit.info/ javascript-sha1.html
Why are you looking for a jQuery plugin? There are multiple implementations of MD5 and SHA1 available in JavaScript that turn any string into a hash string and that can easily be used with jQuery.
Here is the first Google result for "JavaScript sha1":
http://www.webtoolkit.info/javascript-sha1.html
我强烈建议您阅读 Thomas Ptacek 撰写的《彩虹表足够了:您需要了解的安全密码方案》。这是回程机器的链接(如果 markdown 将停止吃它):
http://web.archive.org/web/20071228050037/http ://www.matasano.com/log/958/enough-with-the-rainbow-tables-what-you-need-to-know-about-secure-password-schemes/
第一个跳转的内容适用于您的场景:
md5
严重损坏。那里还有其他好东西,我无法公正地对待源材料,所以请阅读整篇文章。
更新:谷歌搜索似乎表明可以使用 Apache 将 HTTP 身份验证绑定到您的 CouchDB 应用程序。我建议使用它来滚动您自己的依赖于客户端密码哈希的身份验证协议。
I highly recommend you read "Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes" by Thomas Ptacek. Here's the link to the wayback machine (if markdown will stop eating it):
http://web.archive.org/web/20071228050037/http://www.matasano.com/log/958/enough-with-the-rainbow-tables-what-you-need-to-know-about-secure-password-schemes/
The first thing that jumps out as applicable to your scenario:
md5
is horribly broken.There are other goodies in there, and I can't do the source material justice, so please read the whole thing.
UPDATE: Googling around seems to indicate it's possible to tie in HTTP Authentication to your CouchDB application using Apache. I'd recommend using that over rolling your own authentication protocol that relies on client-side hashing of the password.
如果您想要 MD5 而不是 SHA1,这个效果很好:
http://pajhome.org.uk/加密/md5
If you want MD5 rather than SHA1, this one works pretty well:
http://pajhome.org.uk/crypt/md5
您还可以检查我的 md5 实现。
You could also check my md5 implementation.