diff --git a/Cipher.cpp b/Cipher.cpp index 8e578f6..93268c4 100644 --- a/Cipher.cpp +++ b/Cipher.cpp @@ -111,12 +111,16 @@ GhettoCipher::Flexblock GhettoCipher::Cipher::Decipher(const Flexblock& data, bo return ss.str(); } +#if defined _WIN32 || defined _WIN64 #pragma optimize("", off ) +#endif void GhettoCipher::Cipher::ZeroKeyMemory() { key.reset(); return; } +#if defined _WIN32 || defined _WIN64 #pragma optimize("", on ) +#endif const GhettoCipher::Block GhettoCipher::Cipher::emptyBlock; diff --git a/Feistel.cpp b/Feistel.cpp index 1ecd2b7..f3d1bcf 100644 --- a/Feistel.cpp +++ b/Feistel.cpp @@ -192,7 +192,9 @@ void GhettoCipher::Feistel::GenerateRoundKeys(const Block& seedKey) } // These pragmas only work for MSVC, as far as i know. Beware!!! +#if defined _WIN32 || defined _WIN64 #pragma optimize("", off ) +#endif void GhettoCipher::Feistel::ZeroKeyMemory() { for (Block& key : roundKeys) @@ -200,4 +202,6 @@ void GhettoCipher::Feistel::ZeroKeyMemory() return; } +#if defined _WIN32 || defined _WIN64 #pragma optimize("", on ) +#endif diff --git a/Feistel.vcxproj b/Feistel.vcxproj index cc94d20..86ded4e 100644 --- a/Feistel.vcxproj +++ b/Feistel.vcxproj @@ -24,29 +24,30 @@ {2b2cf665-f5e6-44db-961f-fc81c88a356d} Feistel 10.0 + GhettoCrypt - Application + StaticLibrary true v142 Unicode - Application + StaticLibrary false v142 true Unicode - Application + StaticLibrary true v142 Unicode - Application + StaticLibrary false v142 true @@ -114,7 +115,7 @@ Level3 true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + _WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true @@ -128,7 +129,7 @@ true true true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + _WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true @@ -142,7 +143,6 @@ - diff --git a/Feistel.vcxproj.filters b/Feistel.vcxproj.filters index a2b2106..7a1b5f1 100644 --- a/Feistel.vcxproj.filters +++ b/Feistel.vcxproj.filters @@ -18,9 +18,6 @@ Quelldateien - - Quelldateien - Quelldateien diff --git a/images.jpg b/images.jpg deleted file mode 100644 index d8f2fc7..0000000 Binary files a/images.jpg and /dev/null differ diff --git a/main.cpp b/main.cpp deleted file mode 100644 index 9c46abf..0000000 --- a/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once -#include -#include "Util.h" -#include "GhettoCipherWrapper.h" - -using namespace GhettoCipher; - -void ExampleString() -{ - std::cout << "Example on how to encrypt & decrypt a string:" << std::endl; - - // Get some string - const std::string input = "I am a super secret message!"; - std::cout << input << std::endl; - - // Encrypt - const std::string encrypted = GhettoCryptWrapper::EncryptString(input, "password1"); - std::cout << encrypted << std::endl; - - // Decrypt - const std::string decrypted = GhettoCryptWrapper::DecryptString(encrypted, "password1"); - std::cout << decrypted << std::endl; - - return; -} - -void ExampleFiles() -{ - std::cout << "Example on how to encrypt & decrypt any file:" << std::endl; - - // Encrypt - GhettoCryptWrapper::EncryptFile("main.cpp", "main.cpp.crypt", "password1"); - - // Decrypt - GhettoCryptWrapper::DecryptFile("main.cpp.crypt", "main.cpp.clear", "password1"); - - return; -} - -int main() -{ - ExampleString(); - ExampleFiles(); - - return 0; -}