Rijndael decryption
-
Hi all, Not a C# or even .net programmer so please bare with me. Can C# use the Rijendeal/AES block cipher without it beiing imported from an ASCI file into a keyring? One of our trading partners is asking to send us files encrypted with the above cipher. The code they use themselves is show below but I'm wondering on how & where I'm to store the key values if not on a keyring. Thanks in advance Dave public string DecodeString(byte[] encodedsource) { System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); byte[] bytes = encodedsource; MemoryStream memstream = new MemoryStream(); memstream.Write(bytes, 0, bytes.Length); memstream.Position = 0; SymmetricAlgorithm algorithm = SymmetricAlgorithm.Create("RijnDael"); algorithm.Key = key; algorithm.IV = iv; ICryptoTransform transform = algorithm.CreateDecryptor(); CryptoStream cryptstream = new CryptoStream(memstream, transform, CryptoStreamMode.Read); StreamReader reader = new StreamReader(cryptstream); string returnstring = reader.ReadToEnd(); memstream.Dispose(); reader.Dispose(); cryptstream.Dispose(); return returnstring; }
-
Hi all, Not a C# or even .net programmer so please bare with me. Can C# use the Rijendeal/AES block cipher without it beiing imported from an ASCI file into a keyring? One of our trading partners is asking to send us files encrypted with the above cipher. The code they use themselves is show below but I'm wondering on how & where I'm to store the key values if not on a keyring. Thanks in advance Dave public string DecodeString(byte[] encodedsource) { System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); byte[] bytes = encodedsource; MemoryStream memstream = new MemoryStream(); memstream.Write(bytes, 0, bytes.Length); memstream.Position = 0; SymmetricAlgorithm algorithm = SymmetricAlgorithm.Create("RijnDael"); algorithm.Key = key; algorithm.IV = iv; ICryptoTransform transform = algorithm.CreateDecryptor(); CryptoStream cryptstream = new CryptoStream(memstream, transform, CryptoStreamMode.Read); StreamReader reader = new StreamReader(cryptstream); string returnstring = reader.ReadToEnd(); memstream.Dispose(); reader.Dispose(); cryptstream.Dispose(); return returnstring; }
Forgot describe what the keys look like. I've changed the actual vals for this post. key = ABCDE%^$ABCDE-99 iv = ABCDE$*@ABCDE-99
-
Forgot describe what the keys look like. I've changed the actual vals for this post. key = ABCDE%^$ABCDE-99 iv = ABCDE$*@ABCDE-99
Thats the issue symmetrical ciphers have.Where does one hide the private key. :)