函数参考


_Crypt_Startup

初始化加密库

#include <Crypt.au3>
_Crypt_Startup()

参数

None.

返回值

成功: 返回 True
设置 @error 为 0
失败: 返回 False 并设置 @error:
1 - 打开 Advapi32.dll 失败
2 - 无法获取加密环境

注意/说明

 调用这个函数是可选的.
 为了提供向后兼容性, 对于 Windows 2000 将使用 PROV_RSA_FULL provider 对于 Windows xp 及更高版本使用 PROV_RSA_AES

相关

_Crypt_Shutdown

详情参考

在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.