diff --git a/GCryptLib/exec/main.cpp b/GCryptLib/exec/main.cpp index eea0504..d53da03 100644 --- a/GCryptLib/exec/main.cpp +++ b/GCryptLib/exec/main.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include @@ -14,11 +14,11 @@ void ExampleString() { std::cout << input << std::endl; // Encrypt - const std::string encrypted = GhettoCryptWrapper::EncryptString(input, "password1"); + const std::string encrypted = GCryptWrapper::EncryptString(input, "password1"); std::cout << encrypted << std::endl; // Decrypt - const std::string decrypted = GhettoCryptWrapper::DecryptString(encrypted, "password1"); + const std::string decrypted = GCryptWrapper::DecryptString(encrypted, "password1"); std::cout << decrypted << std::endl; return; @@ -28,10 +28,10 @@ void ExampleFiles() { std::cout << "Example on how to encrypt & decrypt any file:" << std::endl; // Encrypt - GhettoCryptWrapper::EncryptFile("main.cpp", "main.cpp.crypt", "password1"); + GCryptWrapper::EncryptFile("main.cpp", "main.cpp.crypt", "password1"); // Decrypt - GhettoCryptWrapper::DecryptFile("main.cpp.crypt", "main.cpp.clear", "password1"); + GCryptWrapper::DecryptFile("main.cpp.crypt", "main.cpp.clear", "password1"); return; } diff --git a/GCryptLib/include/GCrypt/GhettoCryptWrapper.h b/GCryptLib/include/GCrypt/GCryptWrapper.h similarity index 95% rename from GCryptLib/include/GCrypt/GhettoCryptWrapper.h rename to GCryptLib/include/GCrypt/GCryptWrapper.h index 3490b5d..646e67c 100644 --- a/GCryptLib/include/GCrypt/GhettoCryptWrapper.h +++ b/GCryptLib/include/GCrypt/GCryptWrapper.h @@ -5,7 +5,7 @@ namespace Leonetienne::GCrypt { /** This class is a wrapper to make working with the GhettoCipher * super easy with a python-like syntax */ - class GhettoCryptWrapper { + class GCryptWrapper { public: //! Will encrypt a string and return it hexadecimally encoded. static std::string EncryptString(const std::string& cleartext, const std::string& password); @@ -27,6 +27,7 @@ namespace Leonetienne::GCrypt { private: // No instanciation! >:( - GhettoCryptWrapper(); + GCryptWrapper(); }; } + diff --git a/GCryptLib/src/GhettoCryptWrapper.cpp b/GCryptLib/src/GCryptWrapper.cpp similarity index 79% rename from GCryptLib/src/GhettoCryptWrapper.cpp rename to GCryptLib/src/GCryptWrapper.cpp index a9cd129..04d7f1f 100644 --- a/GCryptLib/src/GhettoCryptWrapper.cpp +++ b/GCryptLib/src/GCryptWrapper.cpp @@ -1,10 +1,10 @@ -#include "GCrypt/GhettoCryptWrapper.h" +#include "GCrypt/GCryptWrapper.h" #include "GCrypt/Cipher.h" #include "GCrypt/Util.h" namespace Leonetienne::GCrypt { - std::string GhettoCryptWrapper::EncryptString(const std::string& cleartext, const std::string& password) { + std::string GCryptWrapper::EncryptString(const std::string& cleartext, const std::string& password) { // Instanciate our cipher and supply a key const Block key = PasswordToKey(password); Cipher cipher(key); @@ -22,7 +22,7 @@ namespace Leonetienne::GCrypt { return ciphertext; } - std::string GhettoCryptWrapper::DecryptString(const std::string& ciphertext, const std::string& password) { + std::string GCryptWrapper::DecryptString(const std::string& ciphertext, const std::string& password) { // Instanciate our cipher and supply a key const Block key = PasswordToKey(password); Cipher cipher(key); @@ -40,7 +40,7 @@ namespace Leonetienne::GCrypt { return cleartext; } - bool GhettoCryptWrapper::EncryptFile(const std::string& filename_in, const std::string& filename_out, const std::string& password, bool printProgressReport) { + bool GCryptWrapper::EncryptFile(const std::string& filename_in, const std::string& filename_out, const std::string& password, bool printProgressReport) { try { // Read the file to bits const Flexblock cleartext_bits = ReadFileToBits(filename_in); @@ -62,7 +62,7 @@ namespace Leonetienne::GCrypt { } } - bool GhettoCryptWrapper::DecryptFile(const std::string& filename_in, const std::string& filename_out, const std::string& password, bool printProgressReport) { + bool GCryptWrapper::DecryptFile(const std::string& filename_in, const std::string& filename_out, const std::string& password, bool printProgressReport) { try { // Read the file to bits const Flexblock ciphertext_bits = ReadFileToBits(filename_in); diff --git a/GCryptLib/test/GCWrapper.cpp b/GCryptLib/test/GCWrapper.cpp index 7abf24e..2a5be98 100644 --- a/GCryptLib/test/GCWrapper.cpp +++ b/GCryptLib/test/GCWrapper.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include "Catch2.h" @@ -17,10 +17,10 @@ TEST_CASE(__FILE__"/Encrypting and decrypting strings works", "[Wrapper]") { std::string decrypted; // Encryption - ciphertext = GhettoCryptWrapper::EncryptString(plaintext, password); + ciphertext = GCryptWrapper::EncryptString(plaintext, password); // Decryption - decrypted = GhettoCryptWrapper::DecryptString(ciphertext, password); + decrypted = GCryptWrapper::DecryptString(ciphertext, password); // Assertion REQUIRE(plaintext == decrypted); @@ -40,10 +40,10 @@ TEST_CASE(__FILE__"/Encrypting and decrypting files works", "[Wrapper]") { // Encryption - GhettoCryptWrapper::EncryptFile(filename_plain, filename_encrypted, password); + GCryptWrapper::EncryptFile(filename_plain, filename_encrypted, password); // Decryption - GhettoCryptWrapper::DecryptFile(filename_encrypted, filename_decrypted, password); + GCryptWrapper::DecryptFile(filename_encrypted, filename_decrypted, password); // Read in both the base, and the decrypted file const Flexblock plainfile = ReadFileToBits(filename_plain);