-
Notifications
You must be signed in to change notification settings - Fork 0
/
CPL.h
52 lines (37 loc) · 1.01 KB
/
CPL.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* File: CPL.h
* Author: gkovalechyn
*
* Created on June 18, 2016, 7:50 PM
*/
#ifndef CPL_H
#define CPL_H
#include <cstdlib>
#include <iomanip>
#include <fstream>
#include "WinUDPSocket.h"
#include "SHA256.h"
#include "aes.h"
class CPL {
public:
virtual ~CPL();
static CPL* getInstance();
bool connect();
WinUDPSocket* getSocket();
bool doHandshake();
void getDecryptionKey();
void initializeDecryptor();
bool decrypt(unsigned char* src, int length, unsigned char* dst);
std::ofstream* getOutputStream();
private:
CPL();
bool getHashOfFile(std::string path, unsigned char* output);
static void initialize();
static CPL* instance;
WinUDPSocket* socket = NULL;
std::ofstream* logFile;
mbedtls_aes_context context;
unsigned char key[16];
unsigned char iv[16];
};
#endif /* CPL_H */