OMBLOWFISH is a low-level OmniMark interface to the Blowfish cryptographic algorithm. The Blowfish encryption algorithm is described in  Bruce Schneier, “Description of a New Variable-Length Key, 64-bit Block Cipher (Blowfish)”, Fast Software Encryption, Cambridge Security Workshop, p. 191–204, December 09–11, 1993.
The library provides functions for encoding and decoding 64-bit quantities using an encryption key. These
64-bit quantities are represented as OmniMark
strings with a length of eight characters. An
string longer than eight characters is rejected; an input
string shorter than
eight characters is padded to a length of eight characters using
A more convenient interface to the Blowfish algorithm is provided by the OMFFBLOWFISH library, which provides filter functions for encrypting and decrypting data in a streaming fashion. It, in turn, uses this library for its low-level implementation.
The OMBLOWFISH library provides three external functions and one external data type; it also provides one conversion function as a convenience.
stateis a data type that represents the state of a decryption or encryption calculation.
decodeis a function that takes a 64-bit quantity and a
state, and returns the decrypted value as a 64-bit quantity, encased as a
encodeis a function that takes a 64-bit quantity and a
state, and returns the encrypted value as a 64-bit quantity, encased as a
set-encryption-keytakes an encryption key as a
stringand a state, and initializes the
stateusing the encryption key.
To use OMBLOWFISH, you must import it into your program using an import declaration such as:
import "omblowfish.xmd" prefixed by blowfish.
This is a complete list of the OMBLOWFISH library external exceptions that may be thrown back to the calling
OmniMark program. These are all catchable using the
Unable to allocate encryption state.
The Blowfish state is not initialized.
The length of the input string cannot exceed eight characters.
The length of the input string cannot be zero.