//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 LUCIFER_H #define LUCIFER_H /* lucifer.h */ #define DE 1 #define EN 0 void lucifer (unsigned char *); void loadkey (unsigned char *, int); /* lucifer.c */ /* LUCIFER cipher: 128 bit key, 128 bit block */ /* Unless otherwise noted Copyright 1995 Willis E. Howard, III */ /* Willis E. Howard, III email: WEHoward@aol.com mail: POB 1473 Elkhart, IN 46515 */ /* under MSDOS, NMAKE /F LUCIFER.MAK all clean */ #include #include #include "crypt.h" #include "hex.h" #include "lucifer.h" #include "nhash.h" /* This routine uses the common interface to CRYPT.C. Generally, the name of this module becomes the name of the executable file. */ static void process_key (char *, char *); static void makekey (char *, char *); /* cipher_doc: This array of strings must have two sections: CIPHER that describes the cipher used and KEY that describes how the key is defined and entered. */ char ** crypt_help_lucifer (); /* 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 but exit on error. */ int crypt_key_lucifer (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_lucifer (); /* 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_lucifer (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_lucifer (char *source, char *dest); /* Convert a string to a key */ static void process_key (char *s, char *key); static void makekey(char * s, char * key); /* LUCIFER is a cryptographic cipher developed by IBM in the early * seventies. It was a predecessor of the DES, and is much simpler * than that cipher. In particular, it has only two substitution * boxes. It does, however, use a 128 bit key and operates on * sixteen unsigned char data blocks... * * This implementation of LUCIFER was crafted by Graven Cyphers at the * University of Toronto, Canada, with programming assistance from * Richard Outerbridge. It is based on the FORTRAN routines which * concluded Arthur Sorkin's article "LUCIFER: A Cryptographic Algorithm", * CRYPTOLOGIA, Volume 8, Number 1, January 1984, pp22-42. The interested * reader should refer to that article rather than this program for more * details on LUCIFER. * * These routines bear little resemblance to the actual LUCIFER cipher, * which has been severely twisted in the interests of speed. They do * perform the same transformations, and are believed to be UNIX portable. * The package was developed for use on UNIX-like systems lacking crypto * facilities. They are not very fast, but the cipher is very strong. * The routines in this file are suitable for use as a subroutine library * after the fashion of crypt(3). When linked together with applications * routines they can also provide a high-level cryptographic system. * * -DENHANCE : modify LUCIFER by changing the key schedule and performing * an "autokeyed" encryption. These may improve the cipher. */ #ifndef DE #define DE 1 /* for separate compilation */ #endif /* lucifer cks # < /dev/null * : 16 bytes : 32186510 6acf6094 87953eba 196f5a75 : * (-DENHANCE) : 378cfd5b bd54a07b 28513809 624e6071 : * (rwo/8412.03.18:10/V5.0) */ /************************ lucifer *******************************/ #endif // LUCIFER_H