初始化加密库
#include <Crypt.au3>
_Crypt_Startup()
成功: | 返回 True |
设置 @error 为 0 | |
失败: | 返回 False 并设置 @error: |
1 - 打开 Advapi32.dll 失败 | |
2 - 无法获取加密环境 |
在MSDN中搜索
#include <Crypt.au3>
_Crypt_Startup() ; To optimize performance start the crypt library, though the same results will be shown if it isn't.
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.." ; Data that will be hashed.
Local $sOutput = "The following results show the supported algorithms for encrypting the data." & @CRLF & @CRLF & _
"Text: " & $sData & @CRLF & _
"3DES: " & _Crypt_EncryptData($sData, $sUserKey, $CALG_3DES) & @CRLF & @CRLF & _
"AES (128bit): " & _Crypt_EncryptData($sData, $sUserKey, $CALG_AES_128) & @CRLF & @CRLF & _
"AES (192bit): " & _Crypt_EncryptData($sData, $sUserKey, $CALG_AES_192) & @CRLF & @CRLF & _
"AES (256bit): " & _Crypt_EncryptData($sData, $sUserKey, $CALG_AES_256) & @CRLF & @CRLF & _
"DES: " & _Crypt_EncryptData($sData, $sUserKey, $CALG_DES) & @CRLF & @CRLF & _
"RC2: " & _Crypt_EncryptData($sData, $sUserKey, $CALG_RC2) & @CRLF & @CRLF & _
"RC4: " & _Crypt_EncryptData($sData, $sUserKey, $CALG_RC4)
MsgBox(4096, "Supported algorithms", $sOutput)
_Crypt_Shutdown() ; Shutdown the crypt library.