Rijndael is symmetric encryption. symmetric encryption uses the same key for encryption and decryption. In October 2000, NIST chose Rijndael (pronounced "Rhine dale") as the AES algorithm to replace DES.
The namespace of Rijndael is:
System. Security. Cryptography
Byte [] plaintextBuffer = System. Text. Encoding. UTF8.GetBytes ("plaintext ");
// Encryption
Rijndael rijndael = Rijndael. Create ();
ICryptoTransform transform = rijndael. CreateEncryptor ();
Byte [] cipherTextBuffer = transform. TransformFinalBlock (plaintextBuffer, 0, plaintextBuffer. Length );
Lbl. Text = Convert. ToBase64String (cipherTextBuffer) + "<br/> ";
Transform. Dispose ();
// Decrypt
Rijndael rijndael2 = Rijndael. Create ();
ICryptoTransform transform2 = rijndael2.CreateDecryptor (rijndael. Key, rijndael. IV );
Byte [] decryption = transform2.TransformFinalBlock (cipherTextBuffer, 0, cipherTextBuffer. Length );
Lbl. Text + = System. Text. Encoding. UTF8.GetString (decryption) + "<br/> ";
Transform2.Dispose ();
The encrypted Key and IV are used for decryption.