Blowfish

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Blowfish

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Blowfish uses one shared key to both encrypt and decrypt data.
A True
B False
2. Which describes the key length of Blowfish?
A Fixed at exactly 56 bits
B Variable length, up to 448 bits
3. How big is each block that Blowfish encrypts at a time?
A 64 bits
B 128 bits
4. Which type of cipher is Blowfish?
A Asymmetric public-key cipher
B Symmetric block cipher
5. A developer wants a cipher they can use in their app without paying a licence fee. Why could Blowfish suit them?
A It is in the public domain, so anyone can use it for free
B It is patented, so only licensed companies can use it

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1cipher = Blowfish(key) AChecks the key is at most 56 bytes (448 bits), the longest key Blowfish allows
2len(key) <= 56 BSets up a Blowfish cipher with one secret key, so the same key encrypts and decrypts the data
3Blowfish encrypts data in fixed 64-bit blocks, which is 8 bytes at a time CBlowfish uses 64-bit blocks, not 128-bit blocks. 128-bit blocks belong to AES.
4Blowfish is a block cipher that is not patented and is free for anyone to use because it is in the public domain DA Blowfish key can be at most 448 bits (56 bytes), so an 800-bit key is too long.
5BLOCK_SIZE = 128 # Blowfish bits ElicenceFee = 0
6key = 'a'*100 # 800-bit Blowfish key FBLOCK_SIZE = 8

Definitions

Blowfish

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
blockBits ← __
2.
maxKeyBits ← ___
3.
blockBits ← 64 OUTPUT _________
4.
isPublicDomain ← ____
5.
IF keyBits __ 448 THEN OUTPUT "Valid Blowfish key" END IF

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A type = "asymmetric"
B cipher = "Blowfish"
C blockBits = 64
Question 2
A keyBytes = 16
B keyBits = keyBytes * 8
C maxBits = 448
D valid = keyBits == maxBits
Question 3
A blockBits = 128
B blockBytes = blockBits // 8
C print(blockBytes)
Question 4
A cipher = "Blowfish"
B maxKeyBits = 64
C minKeyBits = 32
Question 5
A cipher = "Blowfish"
B keyLength = "fixed"
C print(cipher, keyLength)

Answer Key

Blowfish
Section A: Quick Questions
Q1
A — True
Q2
B — Variable length, up to 448 bits
Q3
A — 64 bits
Q4
B — Symmetric block cipher
Q5
A — It is in the public domain, so anyone can use it for free
Section B: Match the Pairs
Q1
cipher = Blowfish(key) → Sets up a Blowfish cipher with one secret key, so the same key encrypts and decrypts the data
Q2
len(key) <= 56 → Checks the key is at most 56 bytes (448 bits), the longest key Blowfish allows
Q3
Blowfish encrypts data in fixed 64-bit blocks, which is 8 bytes at a time → BLOCK_SIZE = 8
Q4
Blowfish is a block cipher that is not patented and is free for anyone to use because it is in the public domain → licenceFee = 0
Q5
BLOCK_SIZE = 128 # Blowfish bits → Blowfish uses 64-bit blocks, not 128-bit blocks. 128-bit blocks belong to AES.
Q6
key = 'a'*100 # 800-bit Blowfish key → A Blowfish key can be at most 448 bits (56 bytes), so an 800-bit key is too long.
Section C: Definitions
Q1
Blowfish — A fast symmetric block cipher with a variable-length key (up to 448 bits) and 64-bit blocks. It is free for anyone to use, as it is in the public domain.
Section D: Fill in the Blanks
Q1
blockBits ← 64
Q2
maxKeyBits ← 448
Q3
blockBits ← 64 OUTPUT blockBits
Q4
isPublicDomain ← TRUE
Q5
IF keyBits <= 448 THEN OUTPUT "Valid Blowfish key" END IF
Section E: Spot the Error
Q1
A — Blowfish is a symmetric cipher because one shared key both encrypts and decrypts. Line 1 should be type = "symmetric".
Q2
D — Blowfish has a variable-length key, so any key up to 448 bits is allowed. The check should be keyBits <= maxBits, not an exact match.
Q3
A — Blowfish works on 64-bit blocks, not 128-bit blocks (AES uses 128). Line 1 should be blockBits = 64.
Q4
B — The maximum Blowfish key length is 448 bits. 64 is the block size, not the key limit. Line 2 should be maxKeyBits = 448.
Q5
B — Blowfish allows a variable-length key, up to 448 bits. Line 2 should be keyLength = "variable".