samsmithnz Posted November 12, 2003 Posted November 12, 2003 I'm adding a custom property to my web.config file, its the encrypted password for the SQL server. It looks like this: <add key="SQLPassword" value="ywfzQ%<&(,;" /> Unfortunetly ASP.NET doesn't like the < in the middle of the string. Is there anyway that I can further encode this?? to prevent the error? thanks Sam Quote Thanks Sam http://www.samsmith.co.nz
bri189a Posted November 12, 2003 Posted November 12, 2003 Um, if it's proably because of the character as I'm sure you guessed, trying using the litteral, crap, my explanation sucks, like in C# if you wanted to display "\\myserver\myshare" you'd actually have to send the string variable "\\\\myserver\\myshare" because the back-slash is a message to the compiler for an escape sequence I think it's called, but with another back-slash behind it, it tells the compiler that you litterally want to use the back-slash as part of the string. It's proabably the same thing here, try putting a backslash in front of it if your doing it in C#, or look through the ASP.NET documentation and figure out what you need to pass to get the literal. Quote
samsmithnz Posted November 12, 2003 Author Posted November 12, 2003 Any idea what that escape code might be in VB? Quote Thanks Sam http://www.samsmith.co.nz
Moderators Robby Posted November 12, 2003 Moderators Posted November 12, 2003 Sam, I don't know if escapes would work in this case or not. You can while encrypting the password (I assume that you're using a Key), keep looping through your're encrypter with new key values until you find one that does not contain any < chars. Just a crude idea. Quote Visit...Bassic Software
samsmithnz Posted November 14, 2003 Author Posted November 14, 2003 Sam, I don't know if escapes would work in this case or not. You can while encrypting the password (I assume that you're using a Key), keep looping through your're encrypter with new key values until you find one that does not contain any < chars. Just a crude idea. The problem is that I need to keep using the current encrpytion method this company uses if possible. Do you know what the esacape key for < is? Quote Thanks Sam http://www.samsmith.co.nz
Moderators Robby Posted November 14, 2003 Moderators Posted November 14, 2003 I may be wrong but I don't know if you can use escapes in that context. Quote Visit...Bassic Software
samsmithnz Posted November 14, 2003 Author Posted November 14, 2003 Yeh I just kind of figured that out too. BUT, I have found another solution. this guy here has a really good encryption algorithm that is xml (and hence web.config) friendly. thanks for your help anyway. Quote Thanks Sam http://www.samsmith.co.nz
*Gurus* Derek Stone Posted November 14, 2003 *Gurus* Posted November 14, 2003 The most common approach for placing encrypted data, that is data that is already encrypted, in an XML file is to base-64 encode it. Simple and easy. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.