使用bcrypt哈希密码进行身份验证

使用bcrypt哈希密码进行身份验证

问题描述:

在我的C ++应用程序中,用户必须登录才能使用该应用程序. 用户登录数据取自phpBB 3.1数据库,该数据库用于密码哈希bcrypt.但是,我没有找到适合C ++的任何示例.

In my C++ application, user must login in order to use the application. The user login data are taken from phpBB 3.1 database, which uses for password hashing bcrypt. However, I didn't found any suitable example for C++.

所以我的问题是:

如何在C ++中使用bcrypt哈希密码对用户进行身份验证?我知道如何使用C ++从外部数据库进行身份验证,我只需要bcrypt的帮助.

How I can auth user with bcrypt hashed password in C++? I know how to do authentication from external database in C++, I just need help with the bcrypt.

谢谢!

BCrypt确实不如可能常见,但是有一个 Openwall的crypt_blowfish .

BCrypt is really not as common as it could be, but there is a * question on What's the recommended Bcrypt C implementation? that will point you to Openwall's crypt_blowfish.

考虑到可靠的C实现,您只需包装一下C ++代码就可以了!

Given a solid C implementation, you need only a wrapper for your C++ code to be good to go!

我还要指出,最有用的Google结果实际上就是这个问题.特别是,Crypto ++库在其计划的功能列表中仍然具有BCrypt.

I would also note that the single most useful Google result is, in fact, this question. In particular, the Crypto++ library still has BCrypt on their planned features list.

使用时,别忘了将工作系数提高到12或14以上!

Don't forget to increase the work factor above 12 or 14 when you use it!

一旦有了可行的实现,如果您想提供合理的开源许可证,我很乐意将其包含在

Once you have a working implementation, if you'd like to give a reasonable open source license, I'd be happy to include it in my Github repository to provide an alternative to PBKDF2 examples!