zoneminder/src/libbcrypt
Andrew Bauer 00183b535a rename bcrypt to libbcrypt to reflect name of the project 2019-06-23 12:56:04 -05:00
..
include/bcrypt rename bcrypt to libbcrypt to reflect name of the project 2019-06-23 12:56:04 -05:00
src rename bcrypt to libbcrypt to reflect name of the project 2019-06-23 12:56:04 -05:00
vs2017 rename bcrypt to libbcrypt to reflect name of the project 2019-06-23 12:56:04 -05:00
CMakeLists.txt rename bcrypt to libbcrypt to reflect name of the project 2019-06-23 12:56:04 -05:00
LICENSE rename bcrypt to libbcrypt to reflect name of the project 2019-06-23 12:56:04 -05:00
README.md rename bcrypt to libbcrypt to reflect name of the project 2019-06-23 12:56:04 -05:00

README.md

libbcrypt

A c++ wrapper around bcrypt password hashing

How to build this

This is a CMake based project:

git clone https://github.com/trusch/libbcrypt
cd libbcrypt
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig

How to use this

Here an example how to use this wrapper class (you can find it in the src/ subdirectory)

#include "bcrypt/BCrypt.hpp"
#include <iostream>

int main(){
	BCrypt bcrypt;
	std::string password = "test";
	std::string hash = bcrypt.generateHash(password);
	std::cout<<bcrypt.validatePassword(password,hash)<<std::endl;
	std::cout<<bcrypt.validatePassword("test1",hash)<<std::endl;
	return 0;
}

build this with something like this:

g++ --std=c++11 -lbcrypt main.cpp