-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrypto.h
More file actions
41 lines (32 loc) · 898 Bytes
/
Copy pathcrypto.h
File metadata and controls
41 lines (32 loc) · 898 Bytes
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
#ifndef crypto_HPP
#define crypto_HPP
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "twofish.h"
#include <fstream>
#include "thread"
#include <string>
class Crypto
{
enum mode {
ECB,
CBC,
CFB,
OFB,
};
mode mode_;
Twofish twofish;
unsigned char vector[16];
public:
Crypto(const unsigned char *_key = 0, int keylen = 0);
void setKey(const unsigned char *_key, int keylen);
void setMode(Crypto::mode mode);
void setMode(std::string mode);
signals:
void send(int);
// void send(std::istream &in, unsigned long int size);
void encrypt(std::istream &in, std::ostream &out,std::string vi, unsigned long int size );
void decrypt(std::istream &in, std::ostream &out,std::string vi, unsigned long int size);
void Calc(std::istream &in, unsigned char plaintext[], int len);
};
#endif // crypto_HPP