File: encrypt_stream_3des.h

package info (click to toggle)
entropybroker 2.9-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,600 kB
  • sloc: cpp: 14,386; sh: 934; makefile: 188; java: 148; perl: 12
file content (23 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <cryptopp/modes.h>
#include <cryptopp/des.h>

class encrypt_stream_3des : public encrypt_stream
{
private:
	CryptoPP::CFB_Mode<CryptoPP::DES_EDE3>::Encryption *enc;
	CryptoPP::CFB_Mode<CryptoPP::DES_EDE3>::Decryption *dec;

public:
	encrypt_stream_3des();
	~encrypt_stream_3des();

	int get_ivec_size();
	int get_key_size();

	bool init(unsigned char *key, int key_len, unsigned char *ivec, bool force=false);

	std::string get_name();

	void encrypt(unsigned char *p_in, int len, unsigned char *p_out);
	void decrypt(unsigned char *p_in, int len, unsigned char *p_out);
};