0
我得到了TSimpleCodec.Begin_EncryptMemory - 错误的模式异常执行以下代码。有什么问题吗?TSimpleCodec.Begin_EncryptMemory - 错误模式
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);
我注意到,如果忘记指定密码,'错误模式'也会出现。在上面的例子中只是注释掉“FCodec.Password:=”。我建议一个特定的错误消息。 – 2012-06-07 13:32:10
好点。我会看看那个。 – 2012-06-08 00:22:38