-
December 21st, 2009, 04:48 PM
#1
How to decrypt data in an XML file?
ok so I got half-way there, I was able to encrypt an element in my XML file, now I want to learn how to decrypt it.
Here is my encryption code:
Code:
System.Xml.XmlDocument myDoc = new System.Xml.XmlDocument();
myDoc.Load("settings.xml");
System.Xml.XmlElement element = myDoc.GetElementsByTagName("TechPass")[0] as System.Xml.XmlElement;
System.Security.Cryptography.TripleDESCryptoServiceProvider tDESkey = new System.Security.Cryptography.TripleDESCryptoServiceProvider();
System.Security.Cryptography.Xml.EncryptedXml encr = new System.Security.Cryptography.Xml.EncryptedXml();
encr.AddKeyNameMapping("Deskey", tDESkey);
System.Security.Cryptography.Xml.EncryptedData ed = encr.Encrypt(element,"Deskey");
System.Security.Cryptography.Xml.EncryptedXml.ReplaceElement(element, ed, false);
myDoc.Save("settings.xml");
Any ideas how I reverse it to read the element and decrypt it and read the result to a string?
-
December 27th, 2009, 04:38 AM
#2
Re: How to decrypt data in an XML file?
Originally Posted by saldous
Any ideas how I reverse it to read the element and decrypt it and read the result to a string?
google? www.google.com
msdn? http://msdn.microsoft.com/en-us/library/ms229749.aspx
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
December 29th, 2009, 03:53 PM
#3
Re: How to decrypt data in an XML file?
Memeloo,
Do you really think you're going to be some kind of "Power Poster" with your BS responses?
-
December 29th, 2009, 03:56 PM
#4
Re: How to decrypt data in an XML file?
Originally Posted by lexavision
Do you really think you're going to be some kind of "Power Poster" with your BS responses?
I don't know. the "BS" abbreviation is unknown to me.
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|