**Blowfish Cipher Tutorials - Herong's Tutorial Examples** - v2.04, by Herong Yang

Blowfish Cipher Algorithm

Tutorial notes and example codes on Blowfish cipher algorithm. Topics include Blowfish encryption algorithm; Blowfish Sub-key and S-box generation schema; Blowfish decryption algorithm and proof; list of first 8336 hex digits of PI; C program to calculate hex digits of PI.

Blowfish Cipher Encryption Algorithm

Key Schedule (Sub-Keys and S-Boxes) Algorithm

Efficient Form of the Blowfish Algorithm

Blowfish Cipher Decryption Algorithm

Proof of Blowfish Cipher Algorithm

Takeaways:

- Blowfish cipher is a 16-round and 64-bit block cipher.
- 18 Sub-keys and 4 S-boxes are derived from a given secret key and hexadecimal digits from constant PI.
- Decryption algorithm is identical to the encryption algorithm except that Sub-keys are applied in reverse order.

Table of Contents

OpenSSL "enc -bf-ecb" for Blowfish/ECB Encryption

OpenSSL "enc -bf-cbc" for Blowfish/CBC Encryption

OpenSSL "enc -bf-cfb" for Blowfish/CFB Encryption

OpenSSL "enc -bf-ofb" for Blowfish/OFB Encryption