密码学:解码CRAM-MD5算法
我有一个 ASP.Net Web 应用程序,我想在其中实现密码安全的加密技术。我没有使用 SSL。
为此我研究并选择了 CRAM-MD5 算法进行密码验证。我已经在 http://pajhome.org.uk/crypt/md5 实现了 javascriptcram-md5 算法/
这里我想知道是否有人使用过它并面临CRAM-MD5认证被黑客解码的情况?
解码 CRAM-MD5 身份验证的可能性有哪些?
I have an ASP.Net web application where I would like to implement cryptography for password security. I am not using SSL.
For that i studied and pick CRAM-MD5 algorithm for password authentication. I have implement javascript cram-md5 algorthim available at http://pajhome.org.uk/crypt/md5/
Here i would like to know that is there anyone used it and face that CRAM-MD5 authentication is decoded by hackers?
What are the possiblities of decoding CRAM-MD5 authentication?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
MD5 不再被认为是安全的,请参阅 MD5 漏洞。为了更安全的实现,请选择不同的哈希算法(例如 SHA-256 或更好)。
MD5 is no longer considered secure, see MD5 vulnerabilities. For a more secure implementation, choose a different hash algorithm (such as SHA-256 or better).
当然,MD5 不再被认为是安全的,但影响他的密码分析漏洞不会影响 HMAC-MD5。这是一个完全不同的野兽。
我确实同意 CRAM-MD5 不是最好的推荐,但它确实与 MD5 的不安全性无关。
了解有什么区别。
请参阅http://www.openauthentication.org/pdfs/Attacks%20on %20SHA-1.pdf, https://www.rfc-editor.org /rfc/rfc6151 和 http://cseweb.ucsd。 edu/~mihir/papers/hmac-new.html
For sure MD5 is no longer considered secure but the cryptanalysis vulnerabilities affecting him does not affect HMAC-MD5. It's a whole different beast.
I do agree that CRAM-MD5 would not be the best recommendation but it really has nothing to do with the insecurity of MD5.
Learn what's the difference.
See http://www.openauthentication.org/pdfs/Attacks%20on%20SHA-1.pdf, https://www.rfc-editor.org/rfc/rfc6151 and http://cseweb.ucsd.edu/~mihir/papers/hmac-new.html
与其他人所说的相反,CRAM-MD5 是标准且可以安全使用。它广泛用于 SASL 中的 IMAP/SMTP 身份验证。您可能正在使用 CRAM-MD5 阅读电子邮件。其他标准哈希算法是 HTTP Digest Authentication 和 PPP 中使用的 CHAP,但由于历史原因它们都使用 MD5。您可以选择更安全的基于 SHA1 的哈希,但您必须推出自己的挑战方案。
因为它使用质询/响应方案,所以它不易受到 MD5 哈希的弱点的影响。除非您有特殊的安全要求,否则请保留其中一种标准算法。
Contrary to what others are saying, CRAM-MD5 is standard and safe to use. It's widely used in SASL for IMAP/SMTP authentication. You might be reading your EMail using CRAM-MD5. The other standard hashing algorithms are HTTP Digest Authentication and CHAP used in PPP but they all uses MD5 due to historical reasons. You can choose more secure SHA1-based hash but you will have to roll your own challenge schemes.
Because it uses challenge/response scheme, it's less vulnerable to the weakness of the MD5 hash. Unless you have special security requirements, stay with one of the standard algorithms.
不要自行实现您的哈希算法。 System.Security 中有经过良好测试的实现。如前所述,不要使用 MD5。
此外,你应该给你的哈希值加盐。例如,如果您有一个带有密码字段的用户表,您可以添加一个盐字段,它只是一个整数,或者一个 GUID,甚至一个时间戳,但是是唯一的。盐可确保数据库中不会出现哈希冲突。 这里是关于加盐的讨论。
Don't self implement your hashing algorithm. There are well tested implementations in System.Security. As stated don't use MD5.
In addition you should salt your hashes. For example if you have a user table with a password field you can add a salt field that is simply an integer, or a guid, or even a timestamp, but something unique. The salt ensures you will not have hash collisions within your database. Here is a discussion on salting.
实施自己的加密技术通常被认为是一个坏主意。
加密算法有很多非常具体的要求,即使其中之一没有得到满足(这通常发生在人们自己做的时候),它通常不会比根本没有加密更安全。
如果您不相信,此 Google 技术讲座应该会有所帮助。
Implementing your own cryptography is generally seen as a bad idea.
Cryptographic algorithms have a lot of very specific demands, and if even one of them isn't met (and that usually happens when people do their own), it usually won't be all too much more secure than no crypto at all.
If you're not convinced, this Google Tech Talk should help.
来自 Wiki:
我害怕使用 md5 哈希算法,因为取回如果密码不够长,可以在几秒钟内完成哈希原始密码(实际上,您可以在 google 上搜索 md5 彩虹表,有些网站将在几秒钟内解码此类哈希并返回结果;))。
From Wiki:
I'd be scared to use md5 hashing algorithm, as getting back the original password from hash can be done in few seconds, if password wasn't long enough (actually, you can google for md5 rainbow table, there are sites that will decode such hash in few seconds and give back the result ;) ).
正如其他人建议的那样;永远不要将 MD5 用于任何用途。
但至于一个实际的答案,它被破坏得有多严重:
嗯,对于任何单哈希来说,它都是单向的,所以你不能从这个意义上“解码”它。然而,您可以做的是以比可接受的速度快得多的速度生成碰撞。这使得攻击者可以强制匹配原本不匹配的内容。它使得任何类型“md5(this) = md5(that) so this = that”的推理验证都是错误的。这会破坏数字签名和其他各种东西。
远离任何形式的 MD5。
-- 编辑
哦,请注意,散列密码不能替代 SSL。 SSL 用于向客户确保他们正在浏览的网站是您的,并保护一般的数据发送。
散列是为了保护您的数据库免受可能的损害。 (并且您始终需要使用盐进行哈希处理;您将盐存储在数据库中用户名旁边)。
As others have advised; don't use MD5, ever, for anything.
But as to an actual answer, how badly is it broken:
Well, with any one-hash it's, well, one-way, so you can't 'decode' it in that sense. What you can do, however, is generate collisions much faster than is acceptable. This allows the attackers to force matches in things that wouldn't otherwise match. It makes any validation of inference of the type 'md5(this) = md5(that) so this = that' wrong. This breaks digital signatures, and all sorts of other things.
Stay away from MD5, in any form.
-- Edit
Oh, and just a note, that hashing the password is no replacement for SSL. SSL is used to ensure, to the client, that the site they are browsing is yours, and to protect general sending of data.
Hashing is about protecting your database from a possible compromise. (And you always need to hash with a salt; you store the salt right next to the username in the db).