473,490 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Encrypting connectionStrings with CustomProvider

I am trying to encrypt the connectionStrings in Web.config with a
custom provider. Works great for me, anyone else tries it they get
errors. Note the error says "decrypt"
My statements I ran on the IIS server to create the key is:
aspnet_regiis -pz WebEncryptionKeys

aspnet_regiis -pc WebEncryptionKeys -exp

aspnet_regiis -px WebEncryptionKeys "%ALLUSERSPROFILE%\Application
Data\Microsoft\Crypto\RSA\MachineKeys\WebEncryptio nKeys_Public.xml"
-pri

aspnet_regiis -pa "WebEncryptionKeys" "NT Authority\Network Service"

The statements I run on the workstation to complie and encrypt is:
aspnet_compiler -v %virtualPath% -p %sourcePath% -f
%destinationPath% -c -nologo

aspnet_regiis -pi "WebEncryptionKeys" "%PublicKeyNameLocation%"

aspnet_regiis -pef "connectionStrings" %destinationPath% -prov
"HrCustomProvider"
The Error Message is:
Encrypting configuration section...

Failed to decrypt using provider 'HrCustomProvider'. Error message
from the provider: Bad Data.

(\\myservername\wwwroot\CriticalSkills\web.config line 19)
The Web.config is:

<configProtectedData>
<providers>
<add name="HrCustomProvider"
keyContainerName="WebEncryptionKeys"
useMachineContainer="true"

type="System.Configuration.RsaProtectedConfigurati onProvider,System.Configuration,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</configProtectedData>
Any ideas on why I can do it and no one else can?
I gave server admin to another user and it still gave the same error.
May 10 '06 #1
1 1685
never mind, the error was with a sql reportviewer; misinterperted the
error.

On Wed, 10 May 2006 09:48:19 -0600, Chuck P <Ch***@newsgroup.nospam>
wrote:
I am trying to encrypt the connectionStrings in Web.config with a
custom provider. Works great for me, anyone else tries it they get
errors. Note the error says "decrypt"
My statements I ran on the IIS server to create the key is:
aspnet_regiis -pz WebEncryptionKeys

aspnet_regiis -pc WebEncryptionKeys -exp

aspnet_regiis -px WebEncryptionKeys "%ALLUSERSPROFILE%\Application
Data\Microsoft\Crypto\RSA\MachineKeys\WebEncrypti onKeys_Public.xml"
-pri

aspnet_regiis -pa "WebEncryptionKeys" "NT Authority\Network Service"

The statements I run on the workstation to complie and encrypt is:
aspnet_compiler -v %virtualPath% -p %sourcePath% -f
%destinationPath% -c -nologo

aspnet_regiis -pi "WebEncryptionKeys" "%PublicKeyNameLocation%"

aspnet_regiis -pef "connectionStrings" %destinationPath% -prov
"HrCustomProvider"
The Error Message is:
Encrypting configuration section...

Failed to decrypt using provider 'HrCustomProvider'. Error message
from the provider: Bad Data.

(\\myservername\wwwroot\CriticalSkills\web.config line 19)
The Web.config is:

<configProtectedData>
<providers>
<add name="HrCustomProvider"
keyContainerName="WebEncryptionKeys"
useMachineContainer="true"

type="System.Configuration.RsaProtectedConfigurat ionProvider,System.Configuration,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</configProtectedData>
Any ideas on why I can do it and no one else can?
I gave server admin to another user and it still gave the same error.

May 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2009
by: steve | last post by:
Hi, I know there are a few free and paid php source code encryption scripts around. Has anyone used one, and any feedback? I am interested in encrypting source that is placed on a remote host....
3
9819
by: Piotr | last post by:
MS has published on its sites javascript encoder, which enables "encrypting" javascript code. It allows hiding js code from being seen as a text file. There is a decoder for it, available in the...
6
2061
by: Dayne | last post by:
Guys, I am writing a database application(vb.net , sql server) and is presently storing the connection settings in a xml file...not very secure though. What is a safer method in a dynamic...
0
875
by: xanthviper | last post by:
Hi there, I am working on encrypting my configuration strings withing my web.config file. I am working in VS 2005 using .NET 2.0 with just a C# asp.net web site. I have been following this HELP...
3
6156
by: Dave | last post by:
I am a user of the ConfigurationSettings.AppSettings("KeyName") in asp.net 1.1 so after reading about the new ConnectionStrings collection in "Intoducing Microsoft ASP.NET 2.0 by Dino Esposito on...
5
2457
by: Chris Dunaway | last post by:
I have an application which is installed on a network share to be run from one or more workstations. I have granted trust to the applications on the workstations and the appropriate permissions on...
2
2256
by: SeeSharp Bint | last post by:
Visual Studio 2005, dotnet, c#. Microsoft SQL Server. Windows XP forms application. Temporarily, for my database application, I have been storing the various elements of database connection...
1
5892
by: =?Utf-8?B?TWlrZSBSb2JiaW5z?= | last post by:
I'm trying to encrypt a connection string in an app.config. This is the app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="test"...
0
3015
by: =?Utf-8?B?cGVsZWdrMQ==?= | last post by:
i work on winxp with Net2 ver 2.0.50727 in the IIS (under ASP.NET) in my web.config file i have : <configuration> <connectionStrings> <add name="local_con" connectionString="Data...
0
7112
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.