-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkeycrypto.h
40 lines (26 loc) · 1.42 KB
/
keycrypto.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
/*--------------------------------------------------------------------*/
/* keycrypto.h */
/* Author: Gerry Wan */
/*--------------------------------------------------------------------*/
#ifndef KEY_CRYPTO_INCLUDED
#define KEY_CRYPTO_INCLUDED
/*--------------------------------------------------------------------*/
/* XOR Encrypt the uiLength input pucInput with 64 bit key pucKey */
void xor_encrypt(unsigned char *pucInput,
unsigned char *pucOutput,
unsigned int uiLength,
unsigned char *pucKey);
/*--------------------------------------------------------------------*/
/* XOR Decrypt the uiLength input pucInput with 64 bit key pucKey */
void xor_decrypt(unsigned char *pucInput,
unsigned char *pucOutput,
unsigned int uiLength,
unsigned char *pucKey);
/*--------------------------------------------------------------------*/
/* Convert int i to a string and place the result in pcBuf */
void intToString(int i, char *pcBuf);
/*--------------------------------------------------------------------*/
/* Convert 32 bit unsigned char array pucArr with length iLen into a
string and place the result in pcBuf */
void arrToString(unsigned char *pucArr, char *pcBuf, int iLen);
#endif