The (weinholt crypto blowfish) library is a complete
implementation of Bruce Schneier's Blowfish cipher. It is a symmetric
block cipher with key length between 8 and 448 bits. The key
length does not affect the performance.
Expands a Blowfish key, which is a bytevector of length between 1 and 56 bytes (the longer the better). The returned key schedule can be used with
blowfish-encrypt!orreverse-blowfish-schedule.
Encrypts the eight bytes at source+source-start using Electronic Code Book (ECB) mode. The result is written to target+target-start.
Reverses a Blowfish key schedule so that it can be used with
blowfish-decrypt!.
The inverse of
blowfish-encrypt!.
Clears the Blowfish key schedule so that it no longer contains cryptographic material. Please note that there is no guarantee that the key material will actually be gone from memory. It might remain in temporary numbers or other values.
Encrypts k bytes in the bytevector source starting at source-start with Blowfish in CBC mode and writes the result to target at target-start.
The argument k must be an integer multiple of 8, which is the block length.
The iv bytevector is an Initial Vector. It should be 8 bytes long, initialized to random bytes. This procedure updates the iv after processing a block.
The inverse of
blowfish-cbc-encrypt!.
Version history:
(0 0) – Initial version.
(0 1) – Added procedures for CBC mode.