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:
const
Key1='JDGHn%/=UHBrgtsh!/';
function TForm1.EncryptString(InString:String):String;
var Res: String;
begin
Codec1.Password := Key1;
Codec1.EncryptString(InString, Res, TEncoding.UTF8);
Result:=Res;
end;
function TForm1.DecryptString(InString:String):String;
var Res: String;
begin
Codec1.Password := Key1;
Codec1.DecryptString(InString, Res, TEncoding.UTF8);
Result:=Res;
end;