本文介绍了asp加密和解密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
—SA
In addition to the answers by Manfred and lewax00: never use MD5 or SHA-1 for any security purposes. MD5 was proven to be broken in 2008, and SHA-1 flaw was found in 2005. Please see:
msdn.microsoft/en-us/library/system.windows.controls.mediaelement.mediaended%28v=vs.100%29.aspx[^],
en.wikipedia/wiki/SHA1[^].
Instead, I would advice using one of the algorithms from the SHA-2 family:
en.wikipedia/wiki/SHA2[^].
You will find implementation of all those algorithm in .NET:
msdn.microsoft/en-us/library/system.security.cryptography.hashalgorithm.aspx[^].
—SA
如何在ASP.NET中解密已经使用MD5格式加密的密码?
How can i decrypt a password that had already encrypted using MD5 format in ASP.NET?
推荐答案"...使用MD5格式加密的密码. ..":不可能,加密与加密哈希相同. MD5 [ ^ ]是一种哈希算法,它严格地以一种方式工作.哈希值一旦被哈希化,就无法从哈希值中重建出来. 问候, 曼弗雷德 "... encrypted using MD5 format ...": No way, is encryption the same as a chryptographic hash. MD5[^] is a hashing algorithm and it works strictly one way. Once something has been hashed it can not be reconstructed from the hash. Regards, Manfred
您永远不需要解密密码.您应该做的是对密码进行哈希处理(如Manfred的回答所述,MD5是哈希算法)并将其存储.要验证密码,请对它进行哈希处理,看看它是否与先前哈希的密码匹配. You should never need to decrypt a password. What you should do is make a hash of the password (as stated in Manfred''s answer, MD5 is a hashing algorithm) and store that. To verify a password, hash it and see if it matches the previously hashed password.
除了Manfred和lewax00的回答:出于任何安全目的,请勿使用MD5或SHA-1. MD5在2008年被证明是可破解的,在2005年发现了SHA-1缺陷.请参阅: msdn.microsoft. com/en-us/library/system.windows.controls.mediaelement.mediaended%28v = vs.100%29.aspx [ ^ ], en.wikipedia/wiki/SHA1 [ ^ ]. 相反,我建议使用SHA-2系列算法之一: en.wikipedia/wiki/SHA2 [ ^ ]. 您将在.NET中找到所有这些算法的实现: msdn.microsoft/en-us/library/system. security.cryptography.hashalgorithm.aspx [ ^ ].
更多推荐
asp.net加密和解密
发布评论