TSimpleCodec.Begin_EncryptMemory - Wrong mode
问题 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); 回答1: When initialising the codec by run-time code, you need