Tidied up example/static test executables
This commit is contained in:
25
GCryptLib/exec/encrypt-decrypt-files.cpp
Normal file
25
GCryptLib/exec/encrypt-decrypt-files.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <GCrypt/GWrapper.h>
|
||||
#include <iostream>
|
||||
|
||||
using namespace Leonetienne::GCrypt;
|
||||
|
||||
int main() {
|
||||
std::cout << "Example on how to encrypt & decrypt any file:" << std::endl;
|
||||
|
||||
// Encrypt
|
||||
GWrapper::EncryptFile(
|
||||
"./execAssets/testimage.bmp",
|
||||
"./execAssets/testimage.bmp.crypt",
|
||||
Key::FromPassword("password1")
|
||||
);
|
||||
|
||||
// Decrypt
|
||||
GWrapper::DecryptFile(
|
||||
"./execAssets/testimage.bmp.crypt",
|
||||
"./execAssets/testimage.bmp.clear.bmp",
|
||||
Key::FromPassword("password1"
|
||||
));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user