GCrypt/main.cpp

45 lines
996 B
C++
Raw Normal View History

2021-12-05 22:40:36 +01:00
#pragma once
2021-12-05 15:47:31 +01:00
#include <iostream>
2021-12-05 22:40:36 +01:00
#include "Util.h"
#include "GhettoCipherWrapper.h"
2021-12-05 17:50:17 +01:00
void ExampleString()
2021-12-05 15:47:31 +01:00
{
std::cout << "Example on how to encrypt & decrypt a string:" << std::endl;
2021-12-06 01:33:55 +01:00
// Get some string
const std::string input = "I am a super secret message!";
std::cout << input << std::endl;
// Encrypt
const std::string encrypted = GhettoCipherWrapper::EncryptString(input, "password1");
std::cout << encrypted << std::endl;
// Decrypt
const std::string decrypted = GhettoCipherWrapper::DecryptString(encrypted, "password1");
std::cout << decrypted << std::endl;
return;
}
void ExampleFiles()
{
std::cout << "Example on how to encrypt & decrypt any file:" << std::endl;
// Encrypt
GhettoCipherWrapper::EncryptFile("main.cpp", "main.cpp.crypt", "password1");
// Decrypt
GhettoCipherWrapper::DecryptFile("main.cpp.crypt", "main.cpp.clear", "password1");
return;
}
int main()
{
ExampleString();
ExampleFiles();
2021-12-05 22:40:36 +01:00
return 0;
}