2019-06-30 17:49:20 +00:00
|
|
|
#ifndef ENCRYPT_H
|
|
|
|
#define ENCRYPT_H
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstring>
|
|
|
|
#include <iostream>
|
2019-07-02 18:40:37 +00:00
|
|
|
#include <sodium.h>
|
|
|
|
#include <string>
|
2019-06-30 17:49:20 +00:00
|
|
|
|
|
|
|
using std::string;
|
2019-07-02 18:40:37 +00:00
|
|
|
/*
|
|
|
|
hash_password takes the password, and encrypts it. This needs to be done,
|
|
|
|
because storing passwords in plaintext is BAD!
|
|
|
|
|
|
|
|
verify_password takes in a password and the hashed password, and then does magic encryption stuff(no, not
|
|
|
|
really. It basically hashes the password with the same salt and other
|
|
|
|
parameters) and to see if the password stored and the given password match.
|
|
|
|
*/
|
2019-06-30 17:49:20 +00:00
|
|
|
|
|
|
|
string hash_password(string password);
|
|
|
|
bool verify_password(string hashed_password, string unhashed_password);
|
|
|
|
|
|
|
|
#endif
|