I'm trying to figure out if the RijndaelManaged.generateKey and
RijndaelManaged.generateIV created an encrypted key and IV. If I attempt to
view this in clear text, it appears that the value is encrypted. How can I
decrypt these two values created by the generate methods? Below is sample
code...
class SymmetricKeyTest
{
public static void Main(string[] args)
{
try
{
RijndaelManaged rm = new RijndaelManaged();
rm.KeySize = 256;
rm.GenerateKey();
rm.GenerateIV();
byte[] theKey = rm.Key;
byte[] theIV = rm.IV;
ASCIIEncoding unicode = new ASCIIEncoding();
string key = unicode.GetString(theKey);
string iv = unicode.GetString(theIV);
Console.WriteLine("Key: {0}", key);
Console.WriteLine("IV: {0}", iv);
}catch(Exception e){
Console.WriteLine(e.Message);
}
Console.ReadLine();
}
}