ala
ala

Reputation: 7290

how to wrap/store the key of TripleDESCryptoServiceProvider

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 ?

Upvotes: 0

Views: 590

Answers (1)

Wolfwyrd
Wolfwyrd

Reputation: 15916

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

Upvotes: 1

Related Questions