I get TSimpleCodec.Begin_EncryptMemory - Wrong mode exception wile executing the following code. Is it something wrong?
FLibrary := TCryptographicLibrary.Create(Self);
FCodec := TCodec.Create(Self);
FCodec.CryptoLibrary := FLibrary;
FCodec.BlockCipherId := 'native.AES-256';
FCodec.ChainModeId := 'native.ECB';
FCodec.Password := 'password';
plain := 'The plain text';
FCodec.EncryptString(plain, astr);
FCodec.DecryptString(dec, astr);
I'm not a programmers... and my english skill is low.
I use Delphi 10.4 Community Edition, LockBox verison 3.4.1.0 (Run-time) and 3.4.0.0 (design-time)
Drop Codec and CryptographicLibrary components to your form (or create run-time)
Set the Key1. (maybe constant). if yout set password once in start your program, and run a function without key setting line, you get error message:TSimpleCodec.Begin_EncryptMemory...
But... If you set password every time, the program will working fine.
Code example: