解密“加密”的文件ASP.NET 2.0 会员密码
我需要解密位于我的 aspnet_Membership 表中的加密(非哈希)密码。在该数据库中,我看到了“密码(已加密)”和“PasswordSalt”字段,并且我可以查看我的 web.config 以找到 machinekey >解密密钥(验证=“SHA1”解密=“AES”)。
注意:我很想使用哈希密码,但出于商业原因,我需要能够使用会员的密码,以便 SSO 进出其他远程系统,因此使用加密(绝对不使用清除 - yukky! )
考虑到所有这些,肯定有一种方法可以将密码检索为清晰、纯文本和可读文本,即解密,但我在找到任何网站或在 stackoverflow 上回答时遇到了真正的麻烦(我正在寻找此处的所有“类似问题”和“具有类似标题的问题”)解释了如何做到这一点。
我找到了 MembershipProvider.DecryptPassword Method 页面,但我仍然无法弄清楚如何在我的代码中实际使用它。我还通过 Google 找到了其他页面,但大多数密码解密示例似乎都没有考虑 salt 和 decryptionKey。
有没有人有从各自位置选择密码、密码盐和解密密钥并使用它们解密 ASP.NET 2.0 会员加密密码的直接示例?
I have a requirement to decrypt the Encrypted (not Hashed) passwords located in my aspnet_Membership table. In that database I see the Password (Encrypted) and PasswordSalt fields, and I can look at my web.config to find the machinekey > decryptionKey (validation="SHA1" decryption="AES").
note: I would love to use Hashed password, but for business reasons I need to be able to use the password for a Member, for SSO into and from other remote systems, hence using Encrypted (definitely NOT using Clear - yukky!)
Given all that, surely there is a way to retrieve the password as Clear, plain and readable text, i.e. decrypted, but I'm having real trouble finding any website, or answer on stackoverflow (and I'm looking at all the "similar questions" and "question with similar titles" here) that explains how this can be done.
I've found the MembershipProvider.DecryptPassword Method page, but I still cannot work out how to actually use this in my code. I've also found other pages, via Google, but most example of password decryption don't appear to take the salt and decrytionKey's into account.
Does anyone have a straight forward example of selecting the password, passwordsalt and decryptionkey from their respective locations, and using them to decypt an ASP.NET 2.0 Membership Encrypted password?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建一个继承自 SqlMembershipProvider 的类,并在其中调用解密。
您需要的所有代码都可以在 中找到纳文·科利 (Naveen Kohli) 的这篇文章:
Create a class that inherits from SqlMembershipProvider and in it you can call the decrypt.
All the code you need for this can be found in this article by Naveen Kohli: