#1 2016-06-07 12:12:13

acarlomagno
Member
Registered: 2016-06-07
Posts: 1

AES rijndael for delphi firemonkey

Hello,
I would use the syncrypto in Delphi Firemonkey ios and android project.

I have problem to compile ... I tried this code ... but I have many compile errors.

the units are not compatible

kind regards
Antonello

---

Uses ...SynCommons, SynCrypto...

procedure TForm1.Button1Click(Sender: TObject);
var
  aes: TAESCBC;
  iv: TAESBlock;
begin
  FillChar(iv, 16, 65); // 65 = A
  aes := TAESCBC.Create(AnsiString('AAAAAAAAAAAAAAAA'), 128, iv);
  Edit1.Text := BinToBase64(aes.EncryptPKCS7('test'));
  aes.Free;
end;

Offline

#2 2016-06-07 14:06:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: AES rijndael for delphi firemonkey

SynCrypto does not work with the NextGen compiler.
It works with FPC as compiler for iOS and Android, but not with Delphi, due to backward incompatibilities introduced by Embarcadero in their compiler.

We have some cross-platform units for the NextGen clients, but it features SHA-256, not AES-256 yet.
See https://github.com/synopse/mORMot/blob/ … Crypto.pas

Offline

Board footer

Powered by FluxBB