2017-09-01 22:40:55 +00:00
|
|
|
#ifndef UDP2RAW_ENCRYPTION_H_
|
|
|
|
#define UDP2RAW_ENCRYPTION_H_
|
2017-07-29 12:32:26 +00:00
|
|
|
|
2017-07-30 08:57:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
//#include "aes.h"
|
|
|
|
//#include "md5.h"
|
2017-07-29 12:32:26 +00:00
|
|
|
#include "common.h"
|
|
|
|
|
2017-07-30 08:57:24 +00:00
|
|
|
|
|
|
|
//using namespace std;
|
|
|
|
|
2017-07-23 11:21:40 +00:00
|
|
|
int my_encrypt(const char *data,char *output,int &len,char * key);
|
|
|
|
int my_decrypt(const char *data,char *output,int &len,char * key);
|
2017-07-22 15:39:35 +00:00
|
|
|
|
|
|
|
int my_encrypt_pesudo_header(uint8_t *data,uint8_t *output,int &len,uint8_t * key,uint8_t *header,int hlen);
|
|
|
|
int my_decrypt_pesudo_header(uint8_t *data,uint8_t *output,int &len,uint8_t * key,uint8_t *header,int hlen);
|
2017-07-24 04:34:42 +00:00
|
|
|
|
2017-07-24 16:04:49 +00:00
|
|
|
|
|
|
|
unsigned short csum(const unsigned short *ptr,int nbytes) ;
|
|
|
|
|
|
|
|
|
2017-08-04 13:46:49 +00:00
|
|
|
enum auth_mode_t {auth_none=0,auth_md5,auth_crc32,auth_simple,auth_end};
|
2017-07-30 08:57:24 +00:00
|
|
|
|
2017-07-25 22:29:40 +00:00
|
|
|
|
2017-07-26 00:51:05 +00:00
|
|
|
enum cipher_mode_t {cipher_none=0,cipher_aes128cbc,cipher_xor,cipher_end};
|
2017-07-30 08:57:24 +00:00
|
|
|
|
2017-07-24 04:34:42 +00:00
|
|
|
|
2017-07-26 00:51:05 +00:00
|
|
|
extern auth_mode_t auth_mode;
|
|
|
|
extern cipher_mode_t cipher_mode;
|
2017-07-30 08:57:24 +00:00
|
|
|
|
|
|
|
extern unordered_map<int, const char *> auth_mode_tostring;
|
|
|
|
extern unordered_map<int, const char *> cipher_mode_tostring;
|
2017-07-24 04:34:42 +00:00
|
|
|
|
2017-09-18 11:34:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int cipher_decrypt(const char *data,char *output,int &len,char * key);
|
|
|
|
int cipher_encrypt(const char *data,char *output,int &len,char * key);
|
|
|
|
|
2017-07-18 16:52:33 +00:00
|
|
|
#endif
|