从ASP.NET 2.0成员身份解密“加密”密码 [英] Decrypting an 'Encrypted' password from ASP.NET 2.0 Membership

查看:188
本文介绍了从ASP.NET 2.0成员身份解密“加密”密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要解密位于我的aspnet_Membership表中的加密(非Hash)密码。在该数据库中,我看到密码(加密)和PasswordSalt字段,我可以看看我的web.config找到machinekey> decryptKey(validation =SHA1decrypt =AES)。

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").

注意:我想使用Hashed密码,但出于业务原因,我需要能够使用会员的密码,SSO进入其他远程系统,因此使用加密(绝对不使用Clear-yukky!)

鉴于这一切,确定有一种方法可以将密码检索为清晰,简单易读的文本,即解密,但是我真的很难找到任何网站,或者在stackoverflow上回答(我在这里查看所有的类似问题和类似的题目),解释了如何做到这一点。

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.

我发现 MembershipProvider.Dec ryptPassword方法页面,但我仍然无法解决如何在我的代码中实际使用这一点。我也通过Google发现了其他页面,但密码解密的绝大多数例子似乎没有考虑到salt和decrypttionKey。

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.

有没有人有直从他们各自的位置选择密码,密码和解密密钥的前向示例,并使用它们来解密ASP.NET 2.0会员加密密码?

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?

推荐答案

您需要的所有代码如下:

All the code you need for this is here:

http://www.byteblocks.com/post/2011/05/03/Decrypt-password-in-SqlMembershipProvider.aspx
让我知道你是否遇到任何障碍。

http://www.byteblocks.com/post/2011/05/03/Decrypt-password-in-SqlMembershipProvider.aspx Let me know if you run into any snags.

创建一个继承自SqlMembershipProvider的类,并且可以调用解密。

Create a class that inherits from SqlMembershipProvider and in it you can call the decrypt.

这篇关于从ASP.NET 2.0成员身份解密“加密”密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆