A secret key and an initialization vector are required for the data encryption. The initializaion vector is used to prevent repetition in the encrypted text. The lengths of secret key and initialization vector depend on the value of key size and block size. They are validated by SymmetricAlgorithm abstract class. This project uses the default setting. Secret key is of 32 characters and initialization vector is of 16 characters. You can use RAMDOM.ORG to generate them.
EncryptAsync
The cipher text is Base64 encoded.
DecryptAsync
The cipher text must be Base64 encoded from the above method.