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?
Re: How to decrypt data in an XML file?
Quote:
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
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?
Re: How to decrypt data in an XML file?
Quote:
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.