Problem with AES and IV

Hello,

I am using TAESEncryption to encrypt with the AES algorithm. I need to set a custom IV. When I do this, unfortunately, it does not work correctly. While debugging the code in AESObj.pas, in the EncryptStream() function, I noticed that you use FAESM internally. Despite setting IVMode=TIVMode.userdefined for the component, this is not propagated to FAESM, and it still uses a random IV.

I added the following in this procedure, at line 513:

if Self.IVMode = TIVMode.rand then FAESM.IVMode := AESModes.TIVMode.rand; if Self.IVMode = TIVMode.userdefined then FAESM.IVMode := AESModes.TIVMode.userdefined;

This fixed the issue. However, I kindly request that you apply the appropriate corrections on your end.

Best regards,
Karol

Hi Karol,
Just found out your comment.
Thanks for spotting this! I will fix it in the next release.
Regards,
bernard

Hi all, I confirmed this issue. Waiting for fix.