1 /** Practical One-time Pad Library
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 #define MAX_CONFIG_LINE 1024 /* should be enough, >MAX_PATH */
24 /* Use read_offset() and write_offset() to access offset. */
28 /** Packaged up encrypted message, ready for transport. */
29 typedef struct _MESSAGE
{
37 FILE *open_offset_file(PAD
*p
, char *mode
);
38 unsigned long read_offset(PAD
*p
);
39 void write_offset(PAD
*p
, unsigned long offset
);
40 void load_pad(char *local_filename
, char *pad_name
);
42 MESSAGE
*unpackage(char *input
);
43 void free_message(MESSAGE
*);
44 unsigned int otp_decrypt(char *input
, char **out
);
45 char *otp_decrypt_msg(MESSAGE
*msg
);