This article discusses ways of encrypting and decrypting an XML file:
http://www.fawcette.com/vsm/2003_03/...efault_pf.aspx
Dim filename As String = _
"c:\SymmetricExample.xml"
Dim FileWriter As FileStream = New _
FileStream(filename,FileMode.Create)
Dim CryptoWriter As CryptoStream = _
New CryptoStream(FileWriter, _
cryptoprovider.CreateEncryptor( _
key,iv), CryptoStreamMode.Write)
This code creates a stream for decrypting a file:
Dim filename As String = _
"c:\SymmetricExample.xml"
Dim FileReader As FileStream = New _
FileStream(filename, FileMode.Open)
Dim CryptoReader As CryptoStream = _
New CryptoStream(FileReader, _
cryptoprovider.CreateDecryptor( _
key,iv), CryptoStreamMode.Read)
Now that you have a stream for encrypting and decrypting data, you can feed
it into an XmlTextReader object for decrypting or an XmlTextWriter object
for encrypting:
Dim XmlDoc As XmlDocument
Dim XmlReader As XmlTextReader = New _
XmlTextReader(CryptoReader)
XmlDoc = New XmlDocument()
XmlDoc.Load(XmlReader)
"EMW" <SomeOne@MicroSoftdotCom> wrote in message
news:40**********************@dreader2.news.tiscal i.nl...
Hi,
I am creating a login part on my page and I wanted to store the username
and
password info in a xml file at the server.
But to make sure nobody but my program can read the xml file, I was
thinking
of using some kind of encryption.
How can I do this?
Is there any known and easy way to do this?
rg,
Eric