Mantis App v0.1.13
Loading...
Searching...
No Matches
auth_utils.cpp File Reference
#include "../../include/mantis/utils/utils.h"
#include <sstream>
#include <iomanip>
#include <libbcrypt.h>
Include dependency graph for auth_utils.cpp:

Namespaces

namespace  mantis
 router.h
 

Functions

std::string mantis::bcryptBase64Encode (const unsigned char *data, size_t len)
 Encode a Salt string to bcrypt base64 format.
 
std::string mantis::generateSalt (int cost=12)
 Generates a salt to be used in hashing user passwords.
 
json mantis::hashPassword (const std::string &password)
 Digests user password + a generated salt to yield a hashed password.
 
json mantis::verifyPassword (const std::string &password, const std::string &stored_hash)
 Verifies user password if it matches the given hashed password.