What is Blowfish and how is it used in cryptography? (2024)

What is Blowfish and how is it used in cryptography? (1)

By

  • Rahul Awati

What is Blowfish?

Blowfish is a variable-length, symmetric, 64-bit block cipher. Designed by Bruce Schneier in 1993 as a "general-purpose algorithm," it was intended to provide a fast, free, drop-in alternative to the aging Data Encryption Standard (DES) and International Data Encryption Algorithm (IDEA) encryption algorithms.

Blowfish is significantly faster than DES and IDEA and is unpatented and available free for all uses. However, it couldn't completely replace DES due to its small block size, which is considered insecure.

Twofish, its successor, addressed the security problem with a larger block size of 128 bits. Nonetheless, full Blowfish encryption has never been broken, and the algorithm is included in many cipher suites and encryption products available today.

Understanding Blowfish

Blowfish features a 64-bit block size and takes a variable-length key, from 32 bits to 448 bits. It consists of 16 Feistel-like iterations, where each iteration operates on a 64-bit block that's split into two 32-bit words. Blowfish uses a single encryption key to both encrypt and decrypt data.

The Blowfish algorithm consists of two major parts:

What is Blowfish and how is it used in cryptography? (2)
  1. Data encryption. Data encryption happens through a 16-round Feistel network, with each round consisting of a key-dependent permutation and a key- and data-dependent substitution. Large, key-dependent S-boxes work with the substitution method and form an integral part of the data encryption system in Blowfish. All encryption operations are XORs -- a type of logic gate -- and additions on 32-bit words.
  2. Key expansion and subkeys. In the key expansion process, maximum size 448-bit keys are converted into several subkey arrays totaling 4,168 bytes. Subkeys form an integral part of the Blowfish algorithm, which uses a large number of them. These subkeys are pre-computed before encryption or decryption can take place.

In Blowfish, the P-array consists of 18 32-bit subkeys and four 32-bit S-boxes with 256 entries each. The subkeys are calculated as follows:

  1. The P-array and S-boxes are initialized with a fixed string of hexadecimal digits of pi.
  2. The first element in the P-array (P1) is now XORed with the first 32 bits of the key, P2 is XORed with the second 32-bits and so on, until all the elements in the P-array are XORed with the key bits.
  3. All-zero strings are encrypted by the algorithm as described in the above steps.
  4. P1 and P2 arrays are replaced with the output from step 3 above.
  5. This output is encrypted by Blowfish with modified subkeys.
  6. The output of step 5 modifies P3 and P4 in the P-array.
  7. This process continues until all the P-arrays and four S-boxes are modified.

In total, Blowfish runs 521 times to generate all the subkeys and processes -- about 4 kilobytes (KB) of data.

Blowfish encryption/decryption process example

Assume the message "Hi world" is to be encrypted with Blowfish. The following are the steps involved:

  1. Initially, the input "Hi world" consists of seven characters plus one space, which is equal to 64 bits or 8 bytes.
  2. The input is split into 32 bits. The left 32 bits -- "Hi w" -- are XORed with P1, which is generated by key expansion to create a value called P1. (Note: P denotes prime number, a number that is not divisible except by 1 and itself.)
  3. Then, P1 runs through a transformative F-function (F In) in which the 32 bits are split into 4 bytes each and passed to the four S-boxes.
  4. The first two values from the first two S-boxes are added to each other and XORed with the third value from the third S-box.
  5. This result is added to the output of the fourth S-box to produce 32 bits as output.
  6. The output of F In is XORed with the right 32 bits of the input message -- "orld" -- to produce output F1'.
  7. Then, F1' replaces the left half of the message, while P1' replaces the right half.
  8. This same process is repeated for successive members of P-array for 16 rounds in total.
  9. Finally, after 16 rounds, the outputs P16' and F16' are XORed with the last two entries of the P-array, i.e., P17 and P18. They are then recombined to produce the 64-bit ciphertext of the input message.
What is Blowfish and how is it used in cryptography? (3)

Advantages of Blowfish

One of the fastest and most compact block ciphers in public use, Blowfish uses a symmetric encryption key to turn data into ciphertext. Almost three decades after it was first developed, Blowfish is still widely used because it offers the following advantages:

  • much faster and more efficient than DES and IDEA algorithms;
  • unpatented and can be freely used by anyone even without a license;
  • despite the complex initialization phase before encryption, the data encryption process is efficient on large microprocessors;
  • provides extensive security for software and applications developed in Java;
  • provides secure access for backup tools; and
  • supports secure user authentication for remote access.

Disadvantages of Blowfish

There are some downsides to using Blowfish for encryption, including the following:

  • Speed is affected when changing keys.
  • The key schedule takes a long time.
  • The small 64-bit block size makes the algorithm vulnerable to birthday attacks, a class of brute-force attacks.
  • Each new key requires preprocessing equivalent to 4 KB of text, which affects its speed, making it unusable for some applications.
What is Blowfish and how is it used in cryptography? (4)

Applications of Blowfish

Blowfish is suitable for a wide range of applications, including the following:

  • bulk encryption
  • random bit generation
  • packet encryption
  • password hashing and management
  • mobile processors
  • email, file or disk encryption
  • data backup
  • Secure Shell

Blowfish is used by many popular products, such as CryptoDisk, PasswordWallet, Access Manager, Symantec NetBackup and SplashID. Many social media platforms and e-commerce websites also use Blowfish to protect user data.

This was last updated in January 2022

Continue Reading About Blowfish

  • Symmetric vs. asymmetric encryption: Decipher the differences
  • Cryptography basics: Symmetric key encryption algorithms
  • Where cloud cryptography fits in a security strategy
  • What are 3 best practices for storage encryption at rest?

Related Terms

What is SSH (Secure Shell) and How Does It Work?
SSH (Secure Shell or Secure Socket Shell) is a network protocol that gives users -- particularly systems administrators -- a ...Seecompletedefinition
What is the Cybersecurity Information Sharing Act (CISA)?
The Cybersecurity Information Sharing Act (CISA) allows United States government agencies and non-government entities to share ...Seecompletedefinition
What is threat detection and response (TDR)? Complete guide
Threat detection and response (TDR) is the process of recognizing potential cyberthreats and reacting to them before harm can be ...Seecompletedefinition

Dig Deeper on Data security and privacy

  • Learn to use Windows registry editor command-line options
  • What is Data Encryption Standard (DES)?By: PeterLoshin
  • Find the best Windows 11 registry cleanerBy: EdTittel
  • SSH2 vs. SSH1 and why SSH versions still matterBy: PeterLoshin
What is Blowfish and how is it used in cryptography? (2024)
Top Articles
25 Best Money-Making Apps UK - From Cashback To Surveys
What Are Commodities? Definition And Examples | Bankrate
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Umn Biology
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Dr. Pierre Goyette

Last Updated:

Views: 6119

Rating: 5 / 5 (70 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Dr. Pierre Goyette

Birthday: 1998-01-29

Address: Apt. 611 3357 Yong Plain, West Audra, IL 70053

Phone: +5819954278378

Job: Construction Director

Hobby: Embroidery, Creative writing, Shopping, Driving, Stand-up comedy, Coffee roasting, Scrapbooking

Introduction: My name is Dr. Pierre Goyette, I am a enchanting, powerful, jolly, rich, graceful, colorful, zany person who loves writing and wants to share my knowledge and understanding with you.