Improve security by preventing replay attacks

This commit is contained in:
Wizou 2022-05-19 01:32:22 +02:00
parent 3be28f0fbd
commit a8d2dfcfa1
4 changed files with 53 additions and 11 deletions

View file

@ -276,7 +276,7 @@ j4WcDuXc2CTHgH8gFTNhp/Y8/SpDOhvn9QIDAQAB
private static byte[] AES_IGE_EncryptDecrypt(Span<byte> input, byte[] aes_key, byte[] aes_iv, bool encrypt)
{
if (input.Length % 16 != 0) throw new ApplicationException("intput size not divisible by 16");
if (input.Length % 16 != 0) throw new ApplicationException("AES_IGE input size not divisible by 16");
// code adapted from PHP implementation found at https://mgp25.com/AESIGE/
var output = new byte[input.Length];