From c739aa0cf8fc885c8cad79d2d639d0ecd49bd5ae Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 5 Jun 2020 17:12:19 +0000 Subject: Release --- encryption.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 encryption.hpp (limited to 'encryption.hpp') diff --git a/encryption.hpp b/encryption.hpp new file mode 100644 index 0000000..b8a1be4 --- /dev/null +++ b/encryption.hpp @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include +#include +#include +#include "structs.hpp" + +#define DEFAULT_PASS "default" + +int encrypt(Options* options, char* data, int size); +int decrypt(Options* options, char* data, int size); + +/* + * CUSTOMIZE THIS TWO METHODS + * + * Currently using basic XOR example encryption + * + */ + +int encrypt(Options* options, char* data, int size) +{ + if(!options->encryption) + return 0; + + for(int i = 0; i < size; i++) + *(data + i) = *(data + i) ^ (int)options->password[0]; + + return 0; +} + +int decrypt(Options* options, char* data, int size) +{ + encrypt(options, data, size); + + return 0; +} -- cgit 1.4.1