8000 GitHub - 1ukidev/libbcrypt: A c++ wrapper around bcrypt password hashing
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

1ukidev/libbcrypt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 a slightly edited example in src/ subdirectory)

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

int main(){
	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

About

A c++ wrapper around bcrypt password hashing

Resources

License

Stars

Watchers

Forks

Languages

  • C 86.3%
  • Assembly 5.5%
  • C++ 4.5%
  • CMake 3.7%
0