You are not logged in.
Pages: 1
Hello,
I am using Delphi 10.4.2, targeting Android32.
There is a previously developed REST web service with MARS Curiosity project which is using mORMot encryption routines. That web server running on Windows and is just fine. Now, I have to develop a small mobile application that is consuming some methods on that web service. Unfortunately, I failed to compile below function on Android32. I get error for SynLZ unit for its asm instructions. It uses SynCommons and SynCrypt units on Win32 platform.
function EncryptItAES(const s: string; const AKey: TBytes): string;
var
Key: TSHA256Digest;
Aes: TAESCFB;
_s: RawByteString;
begin
Result := EmptyStr;
Key := SHA256Digest(Pointer(AKey), Length(AKey));
Aes := TAESCFB.Create(Key, 256);
try
_s := StringToUTF8(s);
_s := BinToBase64(Aes.EncryptPKCS7(_s, True));
Result := UTF8ToString(_s);
finally
Aes.Free();
end;
end;
1) I wonder if I use mORMot2 encryption routines under Android32 and write similar function to above?
2) I can use alternative AES encryption library for Android32. I just don't know how above code each time produce different encrypt data for same input. I appreciate instructions on how to develop same logic using AES library that compiles under Android32? I am confused by checking sources to figure this out.
Thanks & Regards,
Ertan
Offline
Hello,
I was more asking about (2) "IVAtBeginning" implementation. This is the part I could not figure.
Offline
It means that the random 16 bytes of IV are put at the beginning of the output stream, as documented:
// - if IVAtBeginning is TRUE, a random Initialization Vector will be
// generated by TAesPrng and stored at the beginning of the output buffer
Offline
Pages: 1