You are not logged in.
Pages: 1
I use serval online enc/dec services to check the AESECB encryption/decryption result ,
it seems that our SynCrypto TAESECB mode can not get any result same with the online services.
what is your result when do such enc/dec with TAESECB?
the utf8 string key is '123456'
utf8String Data is 'ABC'
All online services results:
PKCS7padding, keysize 256 : h3ivt+HEEOkunT75PoB199xf3tD1LRO/p1/l6Tdrg6I=
PKCS7padding, keysize 128 : FevVdP5MovJAiVEClsvBBQ==
none of them is same as our syncrypto results.
my code like this :
CONST
KEY:RawByteString='123456';
VAR
aKey: TSHA256Digest;
AES:TAESECB;
aa:TAESCFB;
DAT:RawByteString;
sr:RawByteString;
begin
DAT:='ABC';
aKey :=SHA256Digest(KEY);
AES:=TAESECB.Create(aKey,256);
sr:=AES.EncryptPKCS7(DAT);
mmoLog.Lines.Add(BinToBase64(sr));
end;
result is EUouYChaLyxO7ArP0k3G4A==
what is your result with syncrypto?
Last edited by keinn (2019-02-18 19:40:19)
Offline
ECB is correct for sure - it is tested against regular Windows API calls in the SynSelfTests unit.
Something is wrong with your expectation.
Also note that ECB is pretty unsafe, and other modes are recommended - with the proper IV.
Offline
Pages: 1