Parkmanne/headers/encrypt.h

23 lines
647 B
C
Raw Permalink Normal View History

#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>
using std::string;
2019-07-02 18:40:37 +00:00
/*
hash_password takes the password, and encrypts it. This needs to be done,
2019-07-08 20:57:09 +00:00
because storing passwords in plaintext is BAD!
2019-07-02 18:40:37 +00:00
2019-07-08 20:57:09 +00:00
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-07-02 18:40:37 +00:00
*/
string hash_password(string password);
bool verify_password(string hashed_password, string unhashed_password);
#endif