I took over a web app that the developer encrypted the connection string. The connection string looks something like this [mchckjkfiekifjfyhg} (example), he is reading the string as
string con = ASCII.GetString(Convert.FromBase64String(ConfigurationManager.AppSettings["connection"]));
Now, I need to change the string in the web config file, so how can I get the new connection string from plain text to the encrypted string as is currently used?
> I took over a web app that the developer encrypted the connection string. The connection string looks something like this [mchckjkfiekifjfyhg} (example), he is reading the string as
>
> string con = ASCII.GetString(Convert.FromBase64String(ConfigurationManager.AppSettings["connection"]));
>
> Now, I need to change the string in the web config file, so how can I get the new connection string from plain text to the encrypted string as is currently used?
byte[] bytes = System.Text.Encoding.ASCII.GetBytes(originalString);
string encodedString = Convert.ToBase64String(bytes);
Regards,
Mykola
http://marss.co.ua
Patrice - 28 Aug 2007 14:36 GMT
Sorry for being picky but note that the string is "encoded" rather than
"encrypted".
---
Patrice
>> I took over a web app that the developer encrypted the connection string.
>> The connection string looks something like this [mchckjkfiekifjfyhg}
[quoted text clipped - 13 lines]
> Mykola
> http://marss.co.ua
marss - 28 Aug 2007 15:13 GMT
> Sorry for being picky but note that the string is "encoded" rather than
> "encrypted".
Thanks, now I know it :)
Regards,
Mykola
http://marss.co.ua