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