2019-12-27 16:27:39 +01:00
2019-12-27 16:27:39 +01:00
2019-12-27 16:27:39 +01:00
2019-12-27 16:58:31 +01:00
2019-12-27 16:45:09 +01:00
2019-12-27 17:02:37 +01:00

License

Bcrypt.cpp

A C++ wrapper around bcrypt (origin: Open BSD) password hashing

How to use

Here an example how to use this wrapper class

#include "bcrypt.h"
#include <iostream>
#include <string>


int main()
{

    std::string password = "top_secret";

    std::string hash = bcrypt::generateHash(password);

    std::cout << "Hash: " << hash << std::endl;

    std::cout << "\"" << password << "\" : " << bcrypt::validatePassword(password,hash) << std::endl;
    std::cout << "\"wrong\" : " << bcrypt::validatePassword("wrong",hash) << std::endl;

    return 0;
}

output:

Hash: $2b$10$9ngimRxnytdaWoCd4NKPneEb/9dW24/B830XpS8TbExVeGKbukYbG
"top_secret" : 1
"wrong" : 0

You can check the hash online at https://bcrypt-generator.com

S
Description
No description provided
Readme
82 KiB
Languages
C++ 85.5%
C 13.5%
CMake 1%