CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 11/7/2007 5:37:32 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 29 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
byronfromwes92
Asp.Net User
Problem decrypting connection string on server11/7/2007 5:37:32 PM

0/0

Hi.  I have an ASP.NET app that is built and deployed using MsBuild and a web deployment project.  A requirement for the project is to encrypt the connection string on the production server.  The connection string is not in web.config, but in a file called ConnectionStrings.config (catchy, eh?).

On the build server, I created a key with a command similar to the following:

[CODE]
aspnet_regiis -pc "KeyName" -exp -csp "Microsoft Strong Cryptographic Provider"
[/CODE]

I export the key to an XML file with this command:

[CODE]
aspnet_regiis -px "KeyName" "c:\KeyName.xml"
[/CODE]

I copy the XML file to the production server and then import it with the following command:

[CODE]
aspnet_regiis -pi "KeyName" "c:\KeyName.xml"
[/CODE]

Back on the build server, I encrypt  the connection strings with the following command:

[CODE]
aspnet_regiis -pef "connectionStrings" "c:\inetpub\wwwroot" -prov "ProviderName"
[/CODE]

When a deployment occurs, the ConnectionStrings.config file gets copied to the production server with all the other app code.  After the deployment is complete, any attempts to run the app or to manually decrypt the connection strings are met with an error message:

Parser Error Message: Failed to decrypt using provider 'ProviderName'. Error message from the provider: Bad Data.

I don't know what I'm missing, but I hope someone can help me.  Thanks!
 


 

byronfromwes92
Asp.Net User
Re: Problem decrypting connection string on server11/8/2007 10:14:29 PM

0/0

I figured this out on my own.  As it turns out, I was using a similarly named, but incorrect KeyName.xml file for import.

Cheers,

Byron

2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning Visual Basic 2005 Databases Authors: Thearon Willis, Pages: 736, Published: 2006
Hacking the Code: ASP.Net Web Application Security Authors: Mark Burnett, James C. Foster, Pages: 447, Published: 2004
Professional ASP.NET 2.0 Databases Authors: Thiru Thangarathinam, Pages: 504, Published: 2007
Beginning ASP.NET 2.0 Databases: Beta Preview Authors: John Kauffman, Thiru Thangarathinam, Pages: 427, Published: 2005
Professional ASP.NET 2.0 XML Authors: Thiru Thangarathinam, Pages: 566, Published: 2005
Microsoft SQL Server 2005 Developer's Guide: Developer's Guide Authors: Michael Otey, Denielle Otey, Pages: 507, Published: 2005
Building Secure Microsoft ASP.NET Applications: Authentication, Authorization, and Secure Communication : Patterns & Practices Authors: Microsoft Corporation Staff, Drew Bird, Microsoft Corporation, Microsoft Corporation, Danielle Voeller Bird, Pages: 586, Published: 2003
Professional ADO.NET 2: Programming with SQL Server 2005, Oracle, and MySQL Authors: Wallace B. McClure, Gregory A. Beamer, John J. Croft, John J. Croft, IV, J. Ambrose Little, Bill Ryan, Phil Winstanley, David Yack, Jeremy Zongker, Pages: 614, Published: 2005
SQL Server Security Authors: Chip Andrews, David Litchfield, Bill Grindlay, ebrary, Inc, Pages: 322, Published: 2003
Hitchhiker's Guide to SQL Server 2000 Reporting Services Authors: Peter Blackburn, William R. Vaughn, Pages: 784, Published: 2004

Web:
Encrypting/Decrypting Connection String Encrypting/Decrypting Connection String. I have my SQL Server connectionstring in my web.config file. I'm scared ...
CodeProject: Encrypt and Decrypt ConnectionString in app.config ... Sep 8, 2007 ... Encrypt and Decrypt ConnectionString in app.config and/or web.config!; Author: Dariush ... Microsoft SQL Server 2000/2005 - Microsoft C#. ...
Encrypting/Decrypting Connection String - bytes Nov 18, 2005 ... decrypt the string. " VB Programmer" wrote: [color=blue] > I have my SQL Server connectionstring in my web.config file. I'm scared ...
Securing connection strings in ASP .Net Apr 10, 2005 ... value="server=(local);Integrated Security=SSPI ... And finally we returned the decrypted connection string to the caller. ...
Factory Codes : Secure the connection string in ASP.NET ... value="server=localhost;uid=sa;pwd=;database=Northwind" />. . . Encrypting and Decrypting the connection strings ...
Encrypting Connection Strings in web.config file You can in the similar way decrypt connection strings information using below ... but, if the malicious user gains access to web server's file system then ...
Connectionstring error after encypted using aspnet_regiis.exe ... So, once I decrypt the connectionstring and re-encrypt with the right keyContainerName, ... Connect MS Access to SQL Server Compact database using ADO ...
ASP.NET 2.0 Encryption/decryption problem. Back on the build server, I encrypt the connection strings with the following ... Encryption/decryption problem. - Byron King 08-Nov-07 02:21 2:21:43 PM ...
Protecting Connection Strings and Other Configuration Information ... Set their Text properties to “Encrypt Connection Strings” and “Decrypt .... the production server will not be able to decrypt the connection string ...
Error - The report server cannot decrypt the symmetric key? - SQL ... Thanks, Mark T. Tag: Error - The report server cannot decrypt the ... Then, go to the Report Manager and reset the connection string in all data sources. ...




Search This Site:










menu control items not being selected, on_click not firing

scalability @ dotnetnuke and other issues

on posting...

picture?

display image from db ??

set datetime format

custom button

c# help, why no output?

how to make rounded-corner tab with tabstrip?

remap urls

why would you make a custom role provider for asp.net membership

parent portal addition failure (dnn 4.0.1)

asp:menu submenu display control

viewstate on a usercontrol

asp button not submitting a form in ie

dnn 2.1.2 email problem

sending email in html or text

gallery issue...

properties not showing up of the inherited control

no asix file in vs2005 ctp-feb ?

customization of createuserwizard control

forms

am i using datakeys correctly?

treeview as nagivation question.

load/save personalization info under different context

architecure

binding a dropdownlist

using wap = loosing performance ?

disable pages

easier way to replace quotes in string

 
All Times Are GMT