Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

decrypt decrypted string using convert.frombase64string()

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 28 Aug 2007 13:16 GMT
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?
marss - 28 Aug 2007 14:10 GMT
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.