how to wrap/store the key of TripleDESCryptoServiceProvider
-
05-07-2019 - |
Question
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 ?
Solution
You can store it in XML if you put it into a CDATA section using the WriteCData method
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow