BLOWFISH(3)

NAME
blf_key, blf_enc, blf_dec - Blowfish encryption

SYNOPSIS
#include <blf.h>
void
blf_key(blf_ctx *state, const u_int8_t *key, u_int16_t keylen);
void
blf_enc(blf_ctx *state, u_int32_t *data, u_int16_t datalen);
void
blf_dec(blf_ctx *state, u_int32_t *data, u_int16_t datalen);

DESCRIPTION
Blowfish is a fast unpatented block cipher designed by Bruce Schneier. It basically consists of a 16 times iterated Feistel network. The block size is 64 bit and the key size is maximal 448 bit.

The blf_key() function initializes the 4 8bit S-boxes and the 18 Subkeys with the hexadecimal digits of Pi. The key is used for further randomization. The first argument to blf_enc() is the initalized state derived from blf_key(). The stream of data is encrypted in Electronic Cookbook Mode (ECB) and datalen must be even. blf_dec() is used for decrypting Blowfish encrypted blocks.

The functions Blowfish_initstate(), Blowfish_expand0state(), Blowfish_expandstate(), Blowfish_encipher() and Blowfish_decipher() are used for customization of the Blowfish cipher, i.e. for the blowfish password hashing function or for implementation of Cipher Block Chaining Mode (CBC).

SEE ALSO
crypt(3), passwd(1), passwd(5)

AUTHOR
Niels Provos <provos@physnet.uni-hamburg.de>