-
Notifications
You must be signed in to change notification settings - Fork 0
/
filehandler.h
31 lines (27 loc) · 870 Bytes
/
filehandler.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
/* PSU CRYPT
Written by Ben Totten
CS585 Cryptography
DES Project
*/
/* Key File */
int getKey(unsigned char *, int *);
void readKey(FILE*, unsigned char*);
/* Plaintext File */
int getPlaintextBlock(FILE*, unsigned char*);
int getPlaintext(FILE*, unsigned char*);
int getPlaintextPSU(FILE*, unsigned char* );
int getTextSize();
unsigned int padBlock(int, unsigned char*);
void padBlockRecurse(int, unsigned char, unsigned char*, unsigned char*);
/* Ciphertext File */
int writeCiphertext(unsigned char*);
int writeCiphertextNoNewline(unsigned char* );
int getCiphertextBlock(FILE*,unsigned char*);
int getCiphertext(FILE*, unsigned char*);
int getCiphertextPSU(FILE*, unsigned char*);
int writePlaintext(unsigned char*);
/* Utility */
void printFile(FILE*);
int getFileSize(FILE*, char*);
void printText(unsigned char* plaintext);
void printKey(unsigned char*);