Symmetrical Key Cryptography
Symmetrical Key Cryptography also known as conventional or
single-key encryption was the primary method of encryption
before the introduction of public key cryptography in the 1970s.
In symmetric-key algorithms, the same keys are used for data
encryption and decryption. This type of cryptography plays a
crucial role in securing data because the same key is used for
both encryption and decryption.
Techniques Used in Symmetric Key Cryptography
Substitution and Transposition are two principal techniques
used in symmetric-key cryptography.
Substitution Techniques
Substitution ciphers work by replacing letters or characters of
the original message (plaintext) with other letters or symbols
based on a rule or key.
1. Caesar Cipher
It is one of the simplest ciphers.
Each letter in the message is shifted by a fixed number.
Example: A → D (shift of 3)
Very weak security because the pattern is easy to guess.
2. Monoalphabetic Cipher
Uses one fixed substitution rule for the entire message.
Each letter is replaced by another letter, number, or symbol.
Example: A → Q, B → W, C → E
More secure than Caesar cipher, but still breakable using
frequency analysis.
3. Playfair Cipher
Encrypts pairs of letters instead of single letters.
Uses a 5×5 matrix made from a secret keyword.
Repeated letters and letter pairs can show patterns.
More secure than simple substitution but still breakable.
4. Hill Cipher
Works on blocks of letters (like 2 or 3 letters together).
Uses matrix multiplication for encryption.
Provides better security than simple ciphers.
However, it has key size limitations and can be attacked if
enough data is available.
5. Polyalphabetic Cipher
Uses multiple substitution alphabets instead of one.
Each letter can be encrypted differently.
Makes frequency analysis difficult.
Vigenère Cipher is a famous example that uses a keyword.
6. One-Time Pad (OTP)
Uses a random key that is the same length as the
message.
The key is used only once and then discarded.
If used correctly, it is 100% secure.
Difficult to use in real life because managing long random
keys is hard.
Transposition Techniques (Simple Explanation)
Transposition techniques do not change the letters of the
message.
They only change the order of the letters to hide the message.
1. Rail Fence Cipher
A simple transposition cipher.
The message is written in a zigzag pattern across multiple
lines (rails).
After writing, the letters are read row by row to form the
ciphertext.
The key is the number of rails.
Easy to understand but not very secure.
2. Columnar Transposition Cipher
The plaintext is written in rows under columns.
Columns are then rearranged according to a secret key.
The ciphertext is formed by reading the columns in the new
order.
More secure than Rail Fence, but still can be broken using
language patterns.
Types of Symmetric Key Cryptography
There are two main types:
1. Stream Ciphers
2. Block Ciphers
Stream Ciphers (Easy Explanation)
Stream ciphers encrypt data one bit or one byte at a time.
A keystream is generated using:
o A secret key
o A nonce (a random number used once)
Plaintext bits are combined with keystream bits using XOR
operation.
Decryption uses the same keystream to recover the original
message.
Suitable for real-time communication.
Common Stream Cipher Algorithms
1. RC4 (Rivest Cipher 4)
Strengths:
o Very fast and simple
o Can handle variable-length data
Current Status:
o Found to have serious weaknesses
o No longer secure
o Banned by most security standards
2. Salsa20
Strengths:
o Fast, efficient, and secure
o Strong protection against known attacks
o Used in many modern systems
Current Status:
o Widely trusted and used
o Good balance between performance and security
3. Grain-128
Strengths:
o Lightweight and efficient
o Works well on devices with low memory and power
o Suitable for RFID tags and sensor networks
Current Status:
o Used in resource-limited environments
o Still provides good security
Block Cipher (Easy Explanation)
Block ciphers encrypt data in fixed-size blocks (e.g., 64 or
128 bits).
Each block is encrypted using the same secret key.
The encrypted blocks form the ciphertext.
At the receiver side, the same key is used to decrypt the
blocks back to plaintext.
Commonly used for file encryption and secure storage.
Common Block Cipher Algorithms (Easy Explanation)
1. Advanced Encryption Standard (AES)
AES is the most widely used block cipher today.
It supports three key sizes:
128-bit, 192-bit, and 256-bit (128-bit is most common).
It is very secure and fast.
Used in:
o Secure communication
o File and disk encryption
o Storage devices
o Digital Rights Management (DRM)
2. Data Encryption Standard (DES)
DES encrypts data in 64-bit blocks using a 56-bit key.
The key size is too small, making DES easy to break using
brute-force attacks.
Because of this weakness, DES is no longer secure.
It led to the development of AES.
3. Triple Data Encryption Standard (Triple DES / TDEA)
Created to improve the security of DES.
It applies the DES algorithm three times:
o Encrypt → Decrypt → Encrypt
More secure than DES but slower.
Now mostly replaced by AES in modern systems.
Applications of Symmetric Key Cryptography (SKC)
Data encryption and decryption
Secure communication
Authenticity verification
File and disk encryption
VPNs
1. Data Encryption and Decryption
Used to protect sensitive data stored or sent over networks.
Examples:
o Email encryption
o User login credentials
o Online banking and financial transactions
2. Secure Communication
Protocols like SSL/TLS use symmetric keys for fast
encryption.
Ensures confidentiality and integrity of data.
A shared secret key is used between sender and receiver.
3. Authenticity Verification
Uses MAC and HMAC techniques.
Ensures that:
o The message is authentic
o The message has not been changed
Protects against tampering.
4. File and Disk Encryption
Used in:
o Full disk encryption
o File encryption tools
Protects data stored on hard drives and USBs.
5. Virtual Private Networks (VPNs)
VPNs create secure communication channels.
Symmetric encryption is used for fast and private data
transfer between users and networks.
Principles of Symmetric Key Encryption
1. Resistance to Brute Force Attacks
The key size must be very large.
A large key space makes it impractical to try all keys.
2. Resistance to Cryptographic Attacks
Ciphertext should look random (high entropy).
Attackers should not learn anything from the encrypted
data.
Protects against:
o Frequency analysis
o Statistical attacks
This concept is called indistinguishability.
Advantages of Symmetric Key Cryptography
1. Speed and Efficiency
Much faster than asymmetric cryptography.
Suitable for large data and real-time communication.
Uses simple operations instead of complex math.
2. Scalability
Works well even when:
o Data size increases
o Number of users increases
Requires less computing power.
3. Simplicity
Easy to understand and implement.
Less complex compared to public key cryptography.
Popular among developers and organizations.
Challenges and Limitations of Symmetric Key
Cryptography (SKC)
1. Key Management and Distribution
In symmetric key cryptography, both sender and receiver
use the same key.
This key must be shared securely.
If a third party gets the key, all encrypted data becomes
insecure.
Managing and safely distributing keys is difficult,
especially for large networks.
2. Non-Repudiation Problem
Non-repudiation means proving who sent a message.
In SKC, since both parties use the same key, it is
impossible to prove who created the message.
Therefore, SKC cannot guarantee non-repudiation.
➡️Because of these issues, symmetric cryptography is often
used together with asymmetric cryptography.
Operation Modes in Symmetric
Cryptography
1. Electronic Codebook (ECB)
The simplest mode of block cipher.
Each plaintext block is encrypted independently.
Problem: Same plaintext blocks produce the same
ciphertext blocks.
Patterns in plaintext become visible → not secure.
2. Cipher Block Chaining (CBC)
Each plaintext block is combined with the previous
ciphertext block before encryption.
Uses XOR operation.
This adds randomness.
Prevents visible patterns in ciphertext.
More secure than ECB.
3. Cipher Feedback (CFB)
Works like a stream cipher.
Generates a keystream that is XORed with plaintext.
Disadvantage:
If one ciphertext block has an error, next blocks are also
affected (error propagation).
4. Output Feedback (OFB)
Converts a block cipher into a stream cipher.
Generates a separate keystream.
Keystream is XORed with plaintext to produce ciphertext.
Errors do not spread to other blocks.
5. Counter (CTR) Mode
Uses a counter value as input to the block cipher.
Converts block cipher into a stream cipher.
Very fast and efficient.
Supports parallel processing.
Commonly used in disk and network encryption.
Attacks on Symmetric Key Cryptography
There are two general ways to attack symmetric cryptography:
1. Cryptanalysis
2. Brute force (already discussed earlier)
Cryptanalysis (Simple Explanation)
Cryptanalysis studies ciphertext patterns to:
o Recover plaintext
o Discover the secret key
The attacker may have different levels of information.
Types of Cryptanalytic Attacks
1. Ciphertext-Only Attack
Attacker knows:
o Encryption algorithm
o Ciphertext only
Tries to guess plaintext or key using patterns.
2. Known-Plaintext Attack
Attacker knows:
o Some plaintext
o Corresponding ciphertext
Uses this information to break the key.
3. Chosen-Plaintext Attack
Attacker can choose plaintext messages.
Obtains their ciphertexts.
Uses this to analyze the encryption system.
4. Chosen-Ciphertext Attack
Attacker chooses ciphertext.
Gets corresponding decrypted plaintext.
Helps in discovering weaknesses in decryption.
5. Chosen-Text Attack
Combination of:
o Chosen plaintext attack
o Chosen ciphertext attack
Very powerful and dangerous attack.
Type of Known to Cryptanalyst
Attack
Ciphertext Encryption algorithm
Only Ciphertext
Known Encryption algorithm
Plaintext Ciphertext
One or more plaintext–ciphertext pairs formed
with the secret key
Chosen Encryption algorithm
Plaintext Ciphertext
Plaintext message chosen by cryptanalyst,
together with its corresponding ciphertext
generated with the secret key
Chosen Encryption algorithm
Ciphertext
Ciphertext
Ciphertext chosen by the the cryptanalyst,
together with its corresponding decrypted
plaintext generated with the secret key
Chosen Text Encryption algorithm
Ciphertext
Plaintext message chosen by cryptanalyst,
together with its corresponding ciphertext
generated with the secret key
Ciphertext chosen by the cryptanalyst,
together with its corresponding decrypted
plaintext generated with the secret key
Brute-Force Attack (Easy Explanation)
In a brute-force attack, the attacker tries every possible
key until the encrypted message turns into readable text.
On average, the attacker must try about 50% of all
possible keys to succeed.
If the attacker finds the correct key:
o All past messages encrypted with that key are
exposed.
o All future messages using the same key are also
compromised.
This is why large key sizes are important.
A larger key means:
o More possible keys
o More time and computing power required
o Attack becomes practically impossible
Keyspace Size of Common Symmetric Ciphers
Cipher Key Length Keyspace Size
Caesar Cipher 1 Alphabet size
Vigenère Cipher n Alphabet sizeⁿ
One-Time Pad Plaintext length Alphabet
size^(plaintext length)
DES 56 bits 2⁵⁶
AES-128 128 bits 2¹²⁸
AES-192 192 bits 2¹⁹²
AES-256 256 bits 2²⁵⁶
ChaCha20 256 bits 2²⁵⁶
➡️Larger keyspace = stronger protection against brute-force
attacks