**Blowfish Cipher Tutorials - Herong's Tutorial Examples** - Version 1.21, by Dr. Herong Yang

Blowfish Cipher Tutorials - Herong's Tutorial Examples

http://www.herongyang.com/Blowfish

Copyright © 2017 by Dr. Herong Yang. All rights reserved.

This Blowfish cipher tutorial book is a collection of notes and sample codes written by the author while he was learning Blowfish cipher himself. Topics include Blowfish, cipher, CBC, CFB, ECB, Java, PHP, Perl, OpenSSL.

Table of Contents

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

First 8336 Fractional Hex Digits of PI

piqpr8.c - Generating Hex Digits of PI

Installing Crypt::Blowfish 2.14 with ActivePerl

Crypt::Blowfish Behavior Tests

Secret Keys with Repeating Pattern

Crypt::Blowfish Verification with Test Vectors

Blowfish Test Vectors with 16-Byte Keys

Installing Crypt::ECB 1.45 with ActivePerl

Crypt::ECB Encryption with No Padding

Crypt::ECB Encryption Test Cases

Installing Crypt::CBC 2.33 with ActivePerl

Crypt::CBC Encryption with Literal Keys

Crypt::CBC Literal Key Error Cases

Crypt::CBC Encryption with Crypt::Blowfish Objects

Crypt::CBC Operation Simulation

Crypt::CBC Encryption Verification

Blowfish CBC 2-Block Test Vectors

Crypt::CBC Prepending IV to Ciphertext

Crypt::CBC Encryption with Salted Keys

Crypt::CBC Salted Key Test Cases

Crypt::CBC Secret Key and IV Algorithm

Crypt::CBC Encryption with Random Salt

Crypt::CBC Padding Option Tests

Crypt::CBC Blowfish Encryption Summary

Installing Crypt::CFB 0.02 with ActivePerl

Crypt::CFB Not Requiring Padding

Crypt::CFB Operation Simulation

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

Installing OpenSSL for Windows

OpenSSL "enc" Blowfish Ciphers

Ways to Control Secret Key and IV

"bf-ecb" Cipher with Literal Key

"bf-ecb" Cipher on Multiple Blocks

Secret Key Padding and Truncation

"bf-ecb" Cipher with Salted Key

Salted Key Generation Algorithm

"bf-ecb" Cipher with Random Salt

OpenSSL Default Padding - PKCS#5

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

"bf-cbc" Cipher with Literal Key

"bf-cbc" Cipher on Multiple Blocks

"bf-cbc" Encryption Verification

"bf-cbc" Cipher with Salted Key

"bf-cbc" Cipher with Random Salt

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

"bf-cfb" Cipher with Literal Key

"bf-cfb" Cipher on Multiple Blocks

"bf-cfb" Encryption Verification

"bf-cfb" Cipher with Salted Key

"bf-cfb" Cipher with Random Salt

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

"bf-ofb" Cipher with Literal Key

"bf-ofb" Cipher on Multiple Blocks

"bf-ofb" Encryption Verification

"bf-ofb" Cipher with Salted Key

**Keywords:** Blowfish, Cipher, Tutorial, Example