Work on base64 decoder (incomplete).
[easyotp.git] / libotp.h
blobf1766427d5eb90f5fb92669b7dab94805ed8031b
1 /** Practical One-time Pad Library
3 * Created:20080514
4 * By Jeff Connelly
5 */
7 #define MARKER_TO "to:"
8 #define MARKER_BEGIN "--EMOTP_BEGIN--"
9 #define MARKER_END "--EMOTP_END--"
11 #define OFFSET_FILE_EXTENSION ".off"
12 #define OFFSET_SIZE 11 /* strlen("4294967296") + 1 */
14 #define PAD_NAME_LENGTH 4
16 /** Packaged up encrypted message, ready for transport. */
17 typedef struct _MESSAGE {
18 unsigned long offset;
19 char pad_name[PAD_NAME_LENGTH];
20 char *cipher_text;
21 } MESSAGE;
23 typedef struct _PAD {
24 char *local_filename;
25 char *name;
26 FILE *fp;
27 struct _PAD *next;
28 /* Use read_offset() and write_offset() to access offset. */
29 } PAD;
31 void show_pads();
32 FILE *open_offset_file(PAD *p, char *mode);
33 unsigned long read_offset(PAD *p);
34 void write_offset(PAD *p, unsigned long offset);
35 void load_pad(char *local_filename);
36 void free_pads();
37 MESSAGE *unpackage();