public void Decrypt_WITH_INVALID_CIPHERTEXT()
{
string aesKeyAlias = "aes_cipher_decrypt_test";
- string password = "test_password";
+ string password = "test_password";\r
/*
* PRECONDITION
* 1. Prepare parameters for encryption
* 2. Create key to operate encryption
- */
- var aesCbc = new Crypto.AesCbcCipherParameters();
- aesCbc.IV = Util.GenerateRandom(16);
- var cipher = new Crypto.Cipher(aesCbc);
+ */\r
+ var aesGcm = new Crypto.AesGcmCipherParameters();
+ aesGcm.IV = Util.GenerateRandom(16);
+ aesGcm.TagLength = 64;
+ aesGcm.AAD = Util.GenerateRandom(32);
+ var cipher = new Crypto.Cipher(aesGcm);
KeyManager.CreateAesKey(256, aesKeyAlias, new Policy(password, false));