Encoding of large file zip

I try to encode with AES128 a zip file of 0.9 GB and after several seconds exception raises on encrypt method of AES object.
The error message is "Integer overflow".
Here my code:
aes:=TAESEncryption.Create(nil);
aes.AType:=AESObj.atCBC;
aes.key:=Key;
aes.outputFormat:=TConvertType.base64;
aes.paddingMode:=TPaddingMode.PKCS7;
aes.IV:=key;
aes.IVMode:=AESObj.userdefined;
cyp:=aes.Encrypt(msg);

where msg is obtained as:

aBytes:=TFile.ReadAllBytes(edFile.Text);
msg:=TEncoding.ANSI.GetString(aBytes);

what I have to do?

I just tested with several 'big files' and got an 'out of memory' error message around 0.015 GB.

Will do more checks. Can you try EncryptStream?

I managed to encrypt 7.44 GB (7 999 238 688 bytes) with:

var
Key: string;
cyp: string;
msg: string;
aBytes: TBytes;
fsIn, fsOut: TStream;

begin

if MyOpendialog.Execute() <> true then
raise Exception.Create('No file');

Key := 'abcdefgh12345678';
aes.AType := AESObj.atCBC;
aes.key := Key;
aes.outputFormat := TConvertType.base64;
aes.paddingMode := TPaddingMode.PKCS7;
aes.IV := '12345678abcdefgh'; // DONT DO Key := IV!!!!!
aes.IVMode := AESObj.userdefined;

fsIn := TFileStream.Create(MyOpendialog.FileName, fmOpenRead);
fsOut := TFileStream.Create('.\AnyLocalFile.encrypted', fmCreate or fmOpenWrite);
aes.EncryptStream(fsIn, fsOut);

fsIn.Free;
fsOut.Free;

MainMemo.Lines.Add('DONE!');

It doesn't solve the base64 conversion but lets you encrypt into a file you can play with.