title: Rijndael decryption in C#
body: <p>I need to decrypt a string using Rijndael and those values:</p>
  
  <p>key size - 192</p>
  
  <p>block size - 128</p>
  
  <p>key - cmdAj45F37I5ud2134FDg2fF</p>
  
  <p>When I'm using the code below I get an error : string size illigle, can anyone help me?</p>
  
  <pre><code>public static string DecryptRijndael(string value, string encryptionKey)
      {
  
              var key = Encoding.UTF8.GetBytes(encryptionKey); //must be 16 chars 
              var rijndael = new RijndaelManaged
              {
                  BlockSize = 128,
                  IV = key,
                  KeySize = 192,
                  Key = key
              };
  
              var buffer = Convert.FromBase64String(value);
              var transform = rijndael.CreateDecryptor();
              string decrypted;
              using (var ms = new MemoryStream())
              {
                  using (var cs = new CryptoStream(ms, transform, CryptoStreamMode.Write))
                  {
                      cs.Write(buffer, 0, buffer.Length);
                      cs.FlushFinalBlock();
                      decrypted = Encoding.UTF8.GetString(ms.ToArray());
                      cs.Close();
                  }
                  ms.Close();
              }
  
              return decrypted;
  
      }
  </code></pre>