Implemented a wrapper for super easy use

This commit is contained in:
Leonetienne
2021-12-06 02:09:03 +01:00
parent fbead384e2
commit 5bcbe09922
5 changed files with 160 additions and 29 deletions

30
GhettoCipherWrapper.h Normal file
View File

@@ -0,0 +1,30 @@
#pragma once
#include <string>
/** This class is a wrapper to make working with the GhettoCipher super easy with a python-like syntax
*/
class GhettoCipherWrapper
{
public:
//! Will encrypt a string and return it hexadecimally encoded.
static std::string EncryptString(const std::string& cleartext, const std::string& password);
//! Will decrypt a hexadecimally encoded string.
static std::string DecryptString(const std::string& ciphertext, const std::string& password);
//! Will encrypt a file.
//! Returns false if anything goes wrong (like, file-access).
//! @filename_in The file to be read.
//! @filename_out The file the encrypted version should be saved in.
static bool EncryptFile(const std::string& filename_in, const std::string& filename_out, const std::string& password);
//! Will decrypt a file.
//! Returns false if anything goes wrong (like, file-access).
//! @filename_in The file to be read.
//! @filename_out The file the decrypted version should be saved in.
static bool DecryptFile(const std::string& filename_in, const std::string& filename_out, const std::string& password);
private:
// No instanciation! >:(
GhettoCipherWrapper();
};