c - Windows Crypto API CryptEncrypt 使用 HashObject

标签 c node.js winapi cryptography mscapi

我正在使用 Windows API CryptEncrypt 和 CALG_AES_256 我想用密码来加密,据我了解

 1. CryptAcquireContext
 2. CryptCreateHash (CALG_MD5)
 3. CryptHashData
 4. CryptDeriveKey
 5. CryptEncrypt

我需要使用nodejs crypto解密并且我使用openssl enc来测试nodejs 解密成功,但使用 C 代码时,消息不同 Windows 如何使用哈希值?

最佳答案

您应该使用密码哈希函数,而不仅仅是普通哈希。密码哈希经过加盐处理,并具有工作因子,使攻击者更难使用字典攻击猜测密码。

Microsoft 已创建 an implementation of PBKDF2在CNG框架中。 PBKDF2 is also contained in OpenSSL .

关于c - Windows Crypto API CryptEncrypt 使用 HashObject,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30572366/

相关文章:

c - C 中的 R3Route URL 路由器

c - 将 gnu make 与 makefile 一起使用,为什么我的 .o 文件没有被删除?

javascript - 如何获取函数内部创建的变量?

winapi - 这是使用 Windows API "safe"的 Rust 代码吗?

c - 为什么这种快速排序不排序

c - 用于线性回归的神经网络

node.js - 如何使用node.js在firebase中存储文件

javascript - 关闭网络套接字不会在服务器上引起事件

c++ - 当 bWaitAll 为 TRUE 时,WaitForMultipleObjects 返回值

c++ - StillImage::GetDeviceList 指针