473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

decrypt decrypted string using convert.frombase64string()

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(Configura tionManager.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?
Aug 28 '07 #1
3 2752
On 28 , 15:16, "Steve" <St...@community.nospam.comwrote:
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(Configura tionManager.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

Aug 28 '07 #2
Sorry for being picky but note that the string is "encoded" rather than
"encrypted".

---
Patrice

"marss" <ma******@gmail.coma écrit dans le message de news:
11**********************@19g2000hsx.googlegroups.c om...
On 28 , 15:16, "Steve" <St...@community.nospam.comwrote:
>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(Configur ationManager.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
>>

Aug 28 '07 #3
On 28 , 16:36, "Patrice" <http://www.chez.com/scribe/wrote:
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

Aug 28 '07 #4

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

Similar topics

3
by: Jimski | last post by:
Hello all, I am having a problem where I get an error message when I call FlushFinalBlock when decrypting my encrypted text. I am using the Rijndael algorithm. The error message is "Length...
4
by: Hrvoje Voda | last post by:
Does anyone knows a good example of how to encrypt/decrypt a string? Hrcko
8
by: Gidi | last post by:
Hi, Is there Buid-In fuction in C# that Encrypt and Decrypt strings? i have a textbox which i'm writing into file, and i want to encrypt it before writing, i'm not looking for something fancy,...
7
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm...
1
by: Mark | last post by:
Hi - I have SSL, and need to collect credit card details for futher processing for a client. Although I have SSL, I still want to ensure the database holds encrypted data too - can anyone point...
4
by: hohans | last post by:
Hi all, I have an encryption class that encrypts and decrypts password using TripleDESCryptoServiceProvider. It was written originally in framework 1.0 and been working fine. And those...
0
by: Hannibal111111 | last post by:
I found this code on a site for doing string encryption/decryption. The string will encrypt fine, but I get this error when I try to decrypt. Any idea why? I posted the code below. The error...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
0
by: FarooqRafiq | last post by:
Hi, My requirement is that a string is encrypted in VB.NET and sent to PHP, PHP decrypts the string (till here the logic is working) and then the PHP should encrtyp (where i am having problems)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.