Authentication with bcrypt hashed password

不想你离开。 提交于 2019-12-02 02:15:43

问题


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:


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!



来源:https://stackoverflow.com/questions/35590105/authentication-with-bcrypt-hashed-password

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!