# Bcrypt.cpp **Repository Path**: zl_java/Bcrypt.cpp ## Basic Information - **Project Name**: Bcrypt.cpp - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-4-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-06-18 - **Last Updated**: 2025-06-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Bcrypt.cpp A C++ wrapper around [bcrypt](https://en.wikipedia.org/wiki/Bcrypt) (origin: Open BSD) password hashing ## How to use Here an example how to use this wrapper class ```cpp #include "bcrypt.h" #include #include 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](https://bcrypt-generator.com/) Former version used Open BSD as origin. Since the hash output was not fully compatible to common web services we now use source from [node.bcrypt](https://github.com/kelektiv/node.bcrypt.js). But also the web services might differ each other, so just use the hashes generated by this library internally in your application.