//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 BLOWFISH_H #define BLOWFISH_H #define MAXKEYBYTES 56 /* 448 bits */ #define little_endian 1 /* Eg: Intel */ // #define big_endian 1 /* Eg: Motorola */ short opensubkeyfile(void); unsigned long F(unsigned long x); void Blowfish_encipher(unsigned long *xl, unsigned long *xr); void Blowfish_decipher(unsigned long *xl, unsigned long *xr); short InitializeBlowfish (char *, short); unsigned int crc (unsigned char , unsigned int ); char ** crypt_help_blowfish (); /* 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_blowfish (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_blowfish (); /* 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_blowfish (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_blowfish (char *source, char *dest); short opensubkeyfile (void); /* read only */ unsigned long F (unsigned long x); void Blowfish_encipher (unsigned long *xl, unsigned long *xr); void Blowfish_decipher (unsigned long *xl, unsigned long *xr); short InitializeBlowfish (char key[], short keybytes); /* crc from PGP - update 16-bit CRC: X^16 + X^12 + X^5 + 1 */ unsigned int crc (unsigned char nuevo, unsigned int value); #endif // BLOWFISH_H