Blowfish ========= .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is Blowfish?** * Blowfish is a **symmetric-key block cipher** created by Bruce Schneier in 1993. * It operates on 64-bit blocks and supports variable key lengths from 32 to 448 bits. * Designed as a fast, unpatented, and secure alternative to DES—especially well-suited for software implementations. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Why is Blowfish useful?** * **Fast and lightweight** – Optimized for 32-bit CPUs and embedded environments * **Flexible key size** – Customizable security strength (32–448 bits) * **Free to use** – Unpatented and royalty-free * **Security** – Strong resistance to known attacks * **Note** – Its 64-bit block size is now a limitation for encrypting large volumes of data .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **How it works** * **Key expansion** – The key is used to generate 18 subkeys and 4 S-boxes * **Encryption** – Uses a 16-round Feistel network on 64-bit blocks (split into 32-bit halves), involving substitution, XOR, and permutation * **Transmission/Storage** – Ciphertext is safely transmitted or stored * **Decryption** – Same process in reverse, applying the subkeys in opposite order .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Where is Blowfish used?** * **File encryption tools** – e.g., GnuPG, early TrueCrypt * **Password hashing** – `bcrypt` is based on Blowfish * **Embedded devices** – Efficient for low-power environments * **VPNs and secure tunnels** – In legacy implementations * **Legacy systems** – Still in use where AES migration hasn’t occurred .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Which OSI layer does this protocol belong to?** * **Presentation Layer (Layer 6)** * Handles encryption and decryption before data reaches the application * Blowfish formats and protects data to ensure confidentiality and secure representation .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Terminology ` * :ref:`Version Info ` * :ref:`Blowfish Version&RFC Details ` * :ref:`Blowfish Basic Setup on Ubuntu using IPv4 ` * :ref:`Blowfish Basic Setup on Ubuntu using IPv6 ` * :ref:`Blowfish Protocol Packet Details ` * :ref:`Blowfish Usecases ` * :ref:`Blowfish Basic Features ` * :ref:`Blowfish Feature : Symmetric Block Cipher ` * :ref:`Blowfish Feature : Variable Key Length ` * :ref:`Blowfish Feature : 16-Round Feistel Network ` * :ref:`Blowfish Feature : Key-Dependent S-boxes ` * :ref:`Blowfish Feature : Fast in Software ` * :ref:`Blowfish Feature : No Licensing Required ` * :ref:`Blowfish Feature : Security Design ` * :ref:`Blowfish Feature : Lightweight Implementation ` * :ref:`Blowfish Feature : Legacy Compatibility ` * :ref:`Blowfish Feature : Basis for bcrypt ` * :ref:`Reference links ` .. _Blowfish_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. _Blowfish_step2: .. tab-set:: .. tab-item:: Terminology * Terminology .. _Blowfish_step3: .. tab-set:: .. tab-item:: Version Info * Version Info .. _Blowfish_step5: .. tab-set:: .. tab-item:: Blowfish Version&RFC Details .. csv-table:: :file: ./Blowfish/blowfish_rfc_details.csv :widths: 10,10,10,30 :header-rows: 1 .. _Blowfish_step20: .. tab-set:: .. tab-item:: Blowfish Basic Setup on Ubuntu using IPv4 * Setup .. _Blowfish_step21: .. tab-set:: .. tab-item:: Blowfish Basic Setup on Ubuntu using IPv6 * Setup .. _Blowfish_step6: .. tab-set:: .. tab-item:: Blowfish Protocol Packet Details **Blowfish key Setup Packet** .. csv-table:: :file: ./Blowfish/blowfish_packet1_details.csv :widths: 10,20,30,10 :header-rows: 1 **Blowfish Encryption Packet** .. csv-table:: :file: ./Blowfish/blowfish_packet2_details.csv :widths: 10,20,30,10 :header-rows: 1 **Blowfish Decryption Packet** .. csv-table:: :file: ./Blowfish/blowfish_packet3_details.csv :widths: 10,20,30,10 :header-rows: 1 .. _Blowfish_step7: .. tab-set:: .. tab-item:: Blowfish Usecases .. csv-table:: :file: ./Blowfish/blowfish_usecases.csv :widths: 10,20,30 :header-rows: 1 .. _Blowfish_step8: .. tab-set:: .. tab-item:: Blowfish Basic Features .. csv-table:: :file: ./Blowfish/blowfish_features.csv :widths: 10,10,30 :header-rows: 1 .. _Blowfish_step9: .. tab-set:: .. tab-item:: Blowfish Feature : Symmetric Block Cipher **Symmetric Block Cipher - Testcases** .. csv-table:: :file: ./Blowfish/blowfish_feature1_test_cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _Blowfish_step10: .. tab-set:: .. tab-item:: Blowfish Feature : Variable Key Length **Variable Key Length - Testcases** .. csv-table:: :file: ./Blowfish/blowfish_feature2_test_cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _Blowfish_step11: .. tab-set:: .. tab-item:: Blowfish Feature : 16-Round Feistel Network **16-Round Feistel Network - Testcases** .. csv-table:: :file: ./Blowfish/blowfish_feature3_test_cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _Blowfish_step12: .. tab-set:: .. tab-item:: Blowfish Feature : Key-Dependent S-boxes **Key-Dependent S-boxes - Testcases** .. csv-table:: :file: ./Blowfish/blowfish_feature4_test_cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _Blowfish_step13: .. tab-set:: .. tab-item:: Blowfish Feature : Fast in Software **Fast in Software - Testcases** .. csv-table:: :file: ./Blowfish/blowfish_feature5_test_cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _Blowfish_step14: .. tab-set:: .. tab-item:: Blowfish Feature : No Licensing Required **No Licensing Required - Testcases** .. csv-table:: :file: ./Blowfish/blowfish_feature6_test_cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _Blowfish_step15: .. tab-set:: .. tab-item:: Blowfish Feature : Security Design **Security Design - Testcases** .. csv-table:: :file: ./Blowfish/blowfish_feature7_test_cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _Blowfish_step16: .. tab-set:: .. tab-item:: Blowfish Feature : Lightweight Implementation **Lightweight Implementation - Testcases** .. csv-table:: :file: ./Blowfish/blowfish_feature8_test_cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _Blowfish_step17: .. tab-set:: .. tab-item:: Blowfish Feature : Legacy Compatibility **Legacy Compatibility - Testcases** .. csv-table:: :file: ./Blowfish/blowfish_feature9_test_cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _Blowfish_step18: .. tab-set:: .. tab-item:: Blowfish Feature : Basis for bcrypt **Basis for bcrypt - Testcases** .. csv-table:: :file: ./Blowfish/blowfish_feature10_test_cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _Blowfish_step19: .. tab-set:: .. tab-item:: Reference links * Reference links