autoit使用des加密解密

直接使用crypt包,默认包含的,不用安装,引用即可
#include <Crypt.au3>

Global $key = "this is the test key";
Global $str = "testvalue"
_Crypt_Startup()
$hKey = _Crypt_DeriveKey($key, $CALG_AES_256)
$s = _Crypt_EncryptData($str, $hKey, $CALG_USERKEY)
ConsoleWrite("Encrypted: " & $s & @CRLF)

$str = _Crypt_DecryptData($s, $hKey, $CALG_USERKEY)
ConsoleWrite("Decrypted: " & BinaryToString($str) & @CRLF)

猜你喜欢

转载自mushme.iteye.com/blog/2326223