//This program is free software: you can redistribute it and/or modify it under the terms #of the GNU General Public License as published by the Free Software Foundation, either #version 3 of the License, or (at your option) any later version.
//This program is distributed in the hope that it will be useful, but WITHOUT ANY #WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A #PARTICULAR PURPOSE. See the GNU General Public License for more details.
//You should have received a copy of the GNU General Public License along with this #program. If not, see
#ifndef OTPF_H
#define OTPF_H
/* otpf.c */
/* XOR with a one time pad file having an offset to start of file. */
/* Copyright 1995 Willis E. Howard, III */
/* Willis E. Howard, III email: WEHoward@aol.com mail: POB 1473 Elkhart, IN 46515 */
/* under MSDOS, NMAKE /F OTPF.MAK all clean */
#include
#include
#include
#include "crypt.h"
#include "tempfile.h"
#include
#include
#include
/*
This routine uses the common interface to CRYPT.C.
Generally, the name of this module becomes the name
of the executable file.
*/
//static int key_defined = 0; /* Set to 1 after a valid key has been defined */
//static int encrypt_or_decrypt_khufu = ENCRYPTION_SELECT;
//static char key_string[257];
/* module specific */
//FILE *otpfile;
//static char otp_name[80];
//static long offset;
//int validate_string (char *);
//static char key_file_name[80];
//void key_update (void);
//long check_key (char *, long);
char ** crypt_help_otpf ();
/*
crypt_key:
Get the key from the passed string (that may be a file name in some
implementations) or from a key file name. Return 0 on success and
non-zero on error.
*/
int crypt_key_otpf (int key_type, char *key_text);
/*
crypt_key_erase:
If a local copy of the key has been made, erase it from memory.
This increases security that the key can not be obtained from
an examination of memory.
*/
void crypt_key_erase_otpf ();
/*
crypt_select:
If encryption and decryption require different ciphers,
this routine defines the direction. Valid choices are
ENCRYPTION_SELECT and DECRYPTION_SELECT.
*/
int crypt_select_otpf (int selection);
/*
crypt_file:
encrypt or decrypt the source to the destination file.
Do not exit from this routine. Return 0 on success
and return 1 on error. Use an fprintf(stderr, ... ) to
report the nature of the error and close any open files.
This allows the main routine to do some cleanup before
exiting.
*/
int crypt_file_otpf (char *source, char *dest);
/* strictly syntax check: name and number */
static int validate_string (char *s);
void key_update (void);
long check_key (char *filename, long start);
#endif // OTPF_H