-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDes.h
More file actions
32 lines (25 loc) · 708 Bytes
/
Des.h
File metadata and controls
32 lines (25 loc) · 708 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
// Des.h: interface for the CDes class.
//
//////////////////////////////////////////////////////////////////////
#pragma once
#define DES_ENCRYPT 1
#define DES_DECRYPT 0
#define ROUNDS 16
typedef struct
{
unsigned long half[2];
}des_keys[16];
class CDes
{
public:
CDes();
virtual ~CDes();
CString DesCrypteString(CString strPass,CString str,int nFlag);
void EnCrypteFile(CString password,CString ming,CString mi);
void DeCrypteFile(CString password,CString mi,CString ming);
private:
int set_key(unsigned char * key);
void SetKey(CString strPass);
void DesCrypte(unsigned char * data_in,unsigned char * data_out,int encrypt_flag);
des_keys m_keys;
};