这听起来像是一个奇怪的问题,我实际上不得不问这个感觉有点奇怪,但是在花了几个小时查看 MSDN 文档以了解添加的 bcrypt
例程之后在 Vista 中,我几乎得出结论,没有实际的 bcrypt 支持!
根据维基百科:
bcrypt is an adaptive cryptographic hash function for passwords ... based on the Blowfish cipher ... Besides incorporating a salt to protect against rainbow table attacks, bcrypt is an adaptive hash: over time it can be made slower and slower so it remains resistant to specific brute-force search attacks against the hash and the salt.
但是,根据 MSDN 上的文档,“bcrypt”库显然实际上是用于加密和散列的通用接口(interface)。您必须通过 BCryptOpenAlgorithmProvider function 获得“算法提供者”的句柄。 ,它有多种内置算法可供选择。但是“河豚”这个词没有出现在列表中的任何地方。
所以我错过了什么吗?我读错了吗?还是 Windows 的“bcrypt”库实际上根本不支持 bcrypt?
最佳答案
在 MSDN 的上下文中,BCrypt 是 “BestCrypt” 的缩写,但它的 PR 名称是:
它在bcrypt.dll
中实现。
BestCrypt/BCrypt/Cng 是旧版 CryptoAPI 的继承者.
Microsoft 正在慢慢从他们的站点中删除对
SHA256Cng Class
This algorithm is for hashing only and does not provide any encryption or decryption. It uses the BCrypt (BestCrypt) layer CNG.
有趣的是(无论如何对我来说).NET 框架通常可以为每种加密算法提供三种实现。例如,对于 SHA2 哈希,有:
- SHA256Managed : 一个纯粹用托管代码编写的实现
- SHA256CryptoServiceProvider : 围绕 native 加密服务提供程序 (CSP) 实现的包装器
- SHA256Cng : 下一代密码学 (Cng) 实现的包装器
精简版
不,bcrypt
是bestcrypt 的缩写。而且,不,它不支持 bcrypt(河豚密码)密码散列。
关于windows - winapi 的 bcrypt.h 实际上支持 bcrypt 哈希吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9711568/