|
楼主 |
发表于 2018-10-13 23:20:45
|
显示全部楼层
江西省吉安市
参照那个帖子的代码改的,
变量名 | 类 型 | 静态 | 数组 | 备 注 | lHHash | | | | lHkey | | | | lHCryptprov | | | | lCryptLength | | | | lCryptBufLen | | | | sCryptBuffer | 字节集 | | | bresult | 逻辑型 | | | 如果真 (取文本长度 (欲加密文本 ) ≠ 0 )bresult = 1 = CryptAcquireContextA (lHCryptprov, 字符 (0 ), “Microsoft Base Cryptographic Provider v1.0”, 1, 0 )如果真 (bresult = 假) bresult = 1 = CryptAcquireContextA (lHCryptprov, 字符 (0 ), “Microsoft Base Cryptographic Provider v1.0”, 1, 8 )如果真 (bresult = 假) bresult = 1 = CryptAcquireContextA (lHCryptprov, 字符 (0 ), “Microsoft Base Cryptographic Provider v1.0”, 1, 4026531840 )如果真 (bresult = 假) bresult = 1 = CryptAcquireContextA (lHCryptprov, 字符 (0 ), “Microsoft Base Cryptographic Provider v1.0”, 1, 32 )如果真 (bresult = 假)返回 ({ })密码 = 选择 (是否为空 (密码), “bbs.125.la”, 密码)CryptCreateHash (lHCryptprov, 32771, 0, 0, lHHash )CryptHashData (lHHash, 到字节集 (密码 ), 取文本长度 (密码 ), 0 )CryptDeriveKey (lHCryptprov, 26625, lHHash, 0, lHkey )CryptDestroyHash (lHHash )lCryptLength = 取文本长度 (欲加密文本 )lCryptBufLen = lCryptLength sCryptBuffer = 取空白字节集 (lCryptLength )sCryptBuffer = 到字节集 (欲加密文本 )bresult = CryptEncrypt (lHkey, 0, 1, 0, sCryptBuffer, lCryptLength, lCryptBufLen )CryptDestroyKey (lHkey )CryptDestroyHash (lHHash )CryptReleaseContext (lHCryptprov, 0 )返回 (选择 (bresult, sCryptBuffer, { }))
|
|