Christoph Hilchenbach 08b7801c90 Merge pull request #1 from shilch/patch-1
Reorganize project for builds using make
2019-12-27 14:34:50 +01:00
2019-12-26 17:28:14 +01:00

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>


using namespace bcrypt;

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

check online https://bcrypt-generator.com

Description
A c++ wrapper around bcrypt password hashing
Readme 92 KiB
Languages
C++ 85.4%
C 13.5%
CMake 1.1%