Authentication with bcrypt hashed password

2019-02-26 11:46发布

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++.

So my question is:

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.

Thank you!

1条回答
Ridiculous、
2楼-- · 2019-02-26 12:48

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

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

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.

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!

查看更多
登录 后发表回答