views:

198

answers:

1

I'm using DES encryption, and I want to store the key of TripleDESCryptoServiceProvider.

But the key consists of (Key + IV),

I was trying to save them in an XML file using

XmlTextWriter
Convert.ToBase64String(...)

but there was an exception due to IV contains invalid characters "=" in XML.

Is there a better way to store symmetric cryptography key ?

+1  A: 

You can store it in XML if you put it into a CDATA section using the WriteCData method

Wolfwyrd