retabbed gcryptlib

This commit is contained in:
Leonetienne
2022-05-16 22:01:52 +02:00
parent ae276e49af
commit c551f5fa64
17 changed files with 576 additions and 662 deletions

View File

@@ -1,4 +1,3 @@
#pragma once
#include <iostream>
#include <GhettoCryptWrapper.h>
#include <SecureBitset.h>
@@ -7,42 +6,40 @@
using namespace GhettoCipher;
void ExampleString()
{
std::cout << "Example on how to encrypt & decrypt a string:" << std::endl;
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;
// 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;
// Encrypt
const std::string encrypted = GhettoCryptWrapper::EncryptString(input, "password1");
std::cout << encrypted << std::endl;
return;
// 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;
void ExampleFiles() {
std::cout << "Example on how to encrypt & decrypt any file:" << std::endl;
// Encrypt
GhettoCryptWrapper::EncryptFile("main.cpp", "main.cpp.crypt", "password1");
// Encrypt
GhettoCryptWrapper::EncryptFile("main.cpp", "main.cpp.crypt", "password1");
// Decrypt
GhettoCryptWrapper::DecryptFile("main.cpp.crypt", "main.cpp.clear", "password1");
// Decrypt
GhettoCryptWrapper::DecryptFile("main.cpp.crypt", "main.cpp.clear", "password1");
return;
return;
}
int main()
{
ExampleString();
//ExampleFiles();
int main() {
ExampleString();
//ExampleFiles();
return 0;
return 0;
}