AES decryption Linux

I am developing a cross platform application for Windows, OSX and Linux and stubled upon an AES problem in LINUX. This code works well in both Windows and OSX but crashes on decryption in Linux. The key is 32 chars fixed in code. It is used for encrypting a DBServer password in the config file. 


function TBaseConfig.encrypt(s: string): string;
var
  aes: TAESEncryption;
begin
  aes := TAESEncryption.Create;
  aes.AType := atCBC;
  aes.KeyLength := kl256;
  aes.Unicode := noUni;
  aes.Key := APPKEY;
  aes.OutputFormat := base64;
  aes.PaddingMode := TpaddingMode.PKCS7;
  aes.IVMode := TIVMode.rand;
  result := aes.encrypt(s);
  aes.Free;
end;

function TBaseConfig.decrypt(s: string): string;
var
  aes: TAESEncryption;
begin
  aes := TAESEncryption.Create;
  aes.AType := atCBC;
  aes.KeyLength := kl256;
  aes.Unicode :=noUni;
  aes.Key := APPKEY;
  aes.outputFormat := base64;
  aes.PaddingMode := TpaddingMode.PKCS7;
  aes.IVMode := TIVMode.rand;
  result := aes.decrypt(s);
  aes.Free;
end;

Thanks for any help and merry christmas!

I forgot to add the error message I receive in Linux: "in AES the cipher text mus have a length multiple of 128 bits"

Finally: Using hecxa as Outputformat it works on all three platforms.

Hello, using HEXA ist no real option for me as its size is very big compared to AES64. SO I would be grateful if you could help me solving that problem. As I stated when decryptiong unter Linux using AES and base64 I get the error:


... in AES, the cipher text must have a length multiple of 128 bits!

I tried padding the base64 string to multiples of 16 characters but this did not solve the problem.

Thanks in advance and a happy new year!

Michael

Hi Michael,
I will take a look to your issue today.
Best regards,
Marion
Hi Michael,
Your issue will be fixed in the 3.3.1.2 version that will be released soon.
Best regards,
Marion