The filesize shall be a multiple of 16.
To save the encrypted data, you can try something like that:
FileName := 'YourFilePath';
if FileExists(FileName) = false then begin
f := FileCreate(FileName);
FileClose(f);
end;
f := FileOpen(FileName, fmOpenWrite);
SetLength(Buffer, Length(s));
for I := 0 to Length(s) - 1 do
Buffer[I] := byte(s[I + 1]);
FileWrite(f, Buffer, 0, Length(s));
FileClose(f);
SetLength(Buffer, 0);