使用提供的密钥解密数据
#Include <Crypt.au3>
_Crypt_DecryptData($vData, $vCryptKey, $iALG_ID [, $fFinal = True])
$vData | 要解密的数据 |
$vCryptKey | 当指定了 CALG_USERKEY 标记时,需提供的密钥密码或句柄 |
$iALG_ID | 使用的算法 |
$fFinal | [可选参数] 设置为 False, 表明只是全部数据的一部分 |
成功: | 返回解密后的数据 |
设置 @error 为 0 | |
失败: | 返回 -1 并设置 @error: |
1 - 无法创建密钥 | |
2 - 无法解密数据 |
在MSDN中搜索
#include <Crypt.au3>
Local Const $sUserKey = "CryptPassword" ; Declare a password string to decrypt/encrypt the data.
Local $sData = "..upon a time there was a language without any standardized cryptographic functions. That language is no more." ; Data that will be encrypted.
Local $bEncrypted = _Crypt_EncryptData($sData, $sUserKey, $CALG_RC4) ; Encrypt the data using the generic password string.
$bEncrypted = _Crypt_DecryptData($bEncrypted, $sUserKey, $CALG_RC4) ; Decrypt the data using the generic password string. The return value is a binary string.
MsgBox(4096, "Decrypted data", BinaryToString($bEncrypted)) ; Convert the binary string using BinaryToString to display the initial data we encrypted.