winapi 的 bcrypt.h 是否真的支持 bcrypt 散列? [英] Does winapi's bcrypt.h actually support bcrypt hashing?

查看:35
本文介绍了winapi 的 bcrypt.h 是否真的支持 bcrypt 散列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能听起来像一个奇怪的问题,我实际上不得不问这个问题感觉有点奇怪,但在花了几个小时查看添加的 bcrypt 例程的 MSDN 文档后在 Vista 中,我几乎得出结论,没有实际的 bcrypt 支持!

根据维基百科:

<块引用>

bcrypt 是一种用于密码的自适应加密散列函数... 基于 Blowfish 密码 ... 除了结合盐以防止彩虹表攻击,bcrypt 是一种自适应hash:随着时间的推移,它会变得越来越慢,所以它仍然存在抵抗针对散列的特定蛮力搜索攻击和盐.

然而,从 MSDN 上的文档来看,bcrypt"库显然实际上是一个用于加密和散列的通用接口.您必须通过 BCryptOpenAlgorithmProvider 函数,有多种内置算法可供选择.但是河豚"这个词没有出现在列表中的任何地方.

所以我错过了什么吗?我读错了吗?还是 Windows 的bcrypt"库实际上根本不支持 bcrypt?

解决方案

在 MSDN 的上下文中,BCrypt 是 BestCrypt" 的缩写,但它的 PR 名称是:><块引用>

加密 API:下一代(Cng)

它在bcrypt.dll 中实现.

BestCrypt/BCrypt/Cng 是旧版 CryptoAPI.

Microsoft 正在慢慢从他们的网站中删除对 BestCrypt" 的引用,但您仍然可以在某些页面中看到它,例如:

<块引用>

SHA256Cng 类

此算法仅用于散列,不提供任何加密或解密.它使用 BCrypt (BestCrypt) 层 CNG.

有趣的是(无论如何对我来说).NET 框架通常可以为您提供每种加密算法的三种实现.例如,对于 SHA2 哈希,有:

短版

不,bcryptbestcrypt 的缩写.而且,不,它不支持 bcrypt(blowfish crypt)密码散列.

This may sound like a strange question, and it feels a bit bizarre that I actually have to ask this, but after spending a couple hours looking over the MSDN documentation for the bcrypt routines that were added in Vista, I've almost reached the conclusion that there is no actual bcrypt support!

According to Wikipedia:

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.

However, from the documentation on MSDN, the "bcrypt" library is apparently actually a generic interface for encryption and hashing. You have to obtain a handle to an "algorithm provider" via the BCryptOpenAlgorithmProvider function, which has several built-in algorithms to choose from. But the word "blowfish" does not appear anywhere in the list.

So am I missing something? Am I reading this wrong? Or does Windows's "bcrypt" library not actually support bcrypt at all?

解决方案

In the context of the MSDN, BCrypt is a shortform of "BestCrypt", but the PR name for it is:

Cryptography API: Next Generation (Cng)

It is implemented in bcrypt.dll.

BestCrypt/BCrypt/Cng is the successor to the older CryptoAPI.

Microsoft is slowly removing references to "BestCrypt" from their site, but you can still see it in some pages like:

SHA256Cng Class

This algorithm is for hashing only and does not provide any encryption or decryption. It uses the BCrypt (BestCrypt) layer CNG.

It's interesting (to me anyway) that the .NET framework generally can provide you three implementations for the each kind of crypto algorithm. For example, for SHA2 hashing, there is:

  • SHA256Managed: an implementation written purely in managed code
  • SHA256CryptoServiceProvider: a wrapper around the native Cryptographic Service Provider (CSP) implementation
  • SHA256Cng: a wrapper around Cryptography Next Gen (Cng) implementation

Short version

No, bcrypt is short for bestcrypt. And, no, it doesn't support bcrypt (blowfish crypt) password hashing.

这篇关于winapi 的 bcrypt.h 是否真的支持 bcrypt 散列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆