zoneminder/dep/libbcrypt
Peter Keresztes Schmidt c33b5a4393 Move in-tree dependencies to their own folder
src/ should only contain our code. Move the in-tree dependencies to dep/
This allows us (if necessary) to e.g. exclude that part of the tree from being analyzed by
various tools or mark it as external code in IDEs.
2021-02-28 02:12:07 +01:00
..
include/bcrypt Move in-tree dependencies to their own folder 2021-02-28 02:12:07 +01:00
src Move in-tree dependencies to their own folder 2021-02-28 02:12:07 +01:00
vs2017 Move in-tree dependencies to their own folder 2021-02-28 02:12:07 +01:00
CMakeLists.txt Move in-tree dependencies to their own folder 2021-02-28 02:12:07 +01:00
LICENSE Move in-tree dependencies to their own folder 2021-02-28 02:12:07 +01:00
README.md Move in-tree dependencies to their own folder 2021-02-28 02:12:07 +01: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