如何解密“DataProtectionConfigurationProvider”在web.config中? [英] How to decrypt "DataProtectionConfigurationProvider" in web.config?

查看:196
本文介绍了如何解密“DataProtectionConfigurationProvider”在web.config中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以解密DataProtectionConfigurationProvider,它负责加密web.config文件中的connectionString。我不是开发系统的人,这就是我需要知道解密值的原因。我一直在谷歌搜索解决方案或变通方法。到目前为止,我已经在Visual Studio命令提示符中尝试了这个:



aspnet_regiis.exe -pefconnectionStrings我的web.config文件路径



不幸的是,我收到此错误:



使用提供程序''DataProtectionConfigurationProvider''无法解密。来自提供程序的错误messafe:密钥无法在指定状态下使用。 (来自HRESULT的异常:0x8009000B)......等等。



我在另一台计算机上解密它。



请帮忙!



谢谢CodeProject偷看!

I want to know if it is possible to decrypt "DataProtectionConfigurationProvider" which is responsible in encrypting the connectionString in the web.config file. I am not the one who developed the system that is why I need to know the decrypted value. I have been searching for solutions or workarounds in google. So far, I have tried this in the Visual Studio Command Prompt:

aspnet_regiis.exe -pef "connectionStrings" "my web.config file path"

Unfortunately, I am getting this error:

Failde to decrypt using provider ''DataProtectionConfigurationProvider''. Error messafe from the provider: Key not valid for use in specified state. (Exception from HRESULT: 0x8009000B)... and so on.

I am decrypting it in a different computer.

Please help!

Thanks CodeProject peeps!

推荐答案

I建议你看看www.asp.net/videos。他们有很多视频可以帮助你。我最近观看了一个关于如何加密和解密配置数据的视频,如连接字符串等......
I recommend you to look at www.asp.net/videos. They have many videos that can help you out. I recently watched a video on how to encrypt and decrypt configuration data such as connection string, etc...


我认为它应该是'' -pd ''而不是''code> -pef ''用于解密。



参考:

MSDN:如何:使用DPAPI加密ASP.NET 2.0中的配置部分 [ ^ ]

MSDN :如何:解密web.config文件 [ ^ ]





更新:

参考:加密ASP.NET 2.0应用程序中的配置信息 [ ^ ]



- - 用于解密特定网站的Web.config文件的通用表单...

aspnet_regiis.exe -pdf部分physical_directory

- - 或 -

aspnet_regiis.exe -pd部分-app virtual_directory





- 具体例子解密特定网站的Web.config文件...

aspnet_regiis.exe -pdfconnectionStringsC:\ Inetpub \wwwroot \ MySite

- 或 -

aspnet_regiis.exe -pdconnectionStrings-app/ MySite

I believe it should be ''-pd'' instead of ''-pef'' for decrypting.

Refer:
MSDN: How To: Encrypt Configuration Sections in ASP.NET 2.0 Using DPAPI[^]
MSDN: How to: Decrypt a web.config File[^]


UPDATE:
Refer: Encrypting Configuration Information in ASP.NET 2.0 Applications[^]

-- Generic form for decrypting the Web.config file for a particular website...
aspnet_regiis.exe -pdf section physical_directory
-- or --
aspnet_regiis.exe -pd section -app virtual_directory


-- Concrete example of decrypting the Web.config file for a particular website...
aspnet_regiis.exe -pdf "connectionStrings" "C:\Inetpub\wwwroot\MySite"
-- or --
aspnet_regiis.exe -pd "connectionStrings" -app "/MySite"


Web.config文件 - ASP.NET [ ^ ]有用的文章。


这篇关于如何解密“DataProtectionConfigurationProvider”在web.config中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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