3
我有以下ActionScript的代码:转换ActionScript来德尔福
function EncryptString(SrcStr:String, KeyStr:String) : String
{
var KeyHexed:* = Hex.toArray(Hex.fromString(KeyStr));
var SrcHexed:* = Hex.toArray(Hex.fromString(SrcStr));
var NullPadded:* = new NullPad();
var Cipher:* = Crypto.getCipher("simple-aes128-cfb8", KeyHexed, NullPadded);
NullPadded.setBlockSize(Cipher.getBlockSize());
Cipher.encrypt(SrcHexed);
return Base64.encodeByteArray(SrcHexed);
}
如何使用Delphi Encryption Compendium (DEC)我转换为德尔福?
感谢您的帮助!
编辑1:
我尝试以下德尔福代码:
function EncryptString(Param1, Param2: String): String;
var
Cipher: TCipher_Rijndael;
begin
Cipher := TCipher_Rijndael.Create;
Cipher.Mode := cmCFB8;
Cipher.Init(Param2, '', $FF);
Result := Cipher.EncodeBinary(TFormat_HEX.Encode(Param1), TFormat_MIME64);
Cipher.Free;
end;
我已将代码添加到问题 – 2012-01-29 16:53:24
好的。所以你有代码。有什么问题? – 2012-01-29 16:53:49
您是使用ANSI还是Unicode德尔福? – 2012-01-29 19:23:59