🔐

Symmetric Key Encryption Overview

Jun 23, 2025

Overview

This lecture introduces symmetric key encryption, focusing on substitution ciphers, Caesar and ROT13 examples, and the differences between block and stream ciphers, including the use of initialization vectors (IVs).

Symmetric Key Encryption

  • Symmetric key algorithms use the same key for both encryption and decryption.
  • The key must remain secret to protect against eavesdroppers.
  • Substitution ciphers replace parts of plaintext with ciphertext using a mapping determined by the key.

Substitution Ciphers

  • A substitution cipher replaces characters in plaintext with others based on a key (the mapping table).
  • The Caesar cipher shifts the alphabet by a set number; the shift amount is the key.
  • ROT13 is a type of Caesar cipher with a shift of 13, making it its own inverse (applying ROT13 twice returns the original text).
  • Example: Encoding "HELLO WORLD" with ROT13 yields "URYYB JBEYQ".

Block and Stream Ciphers

  • Stream ciphers encrypt data one character or digit at a time, producing one output for each input.
  • Block ciphers encrypt data in fixed-size blocks, padding input if necessary to fill the block.
  • Stream ciphers are generally faster and simpler but can be less secure if the key is reused.

Initialization Vectors (IVs) and Key Reuse

  • Key reuse in stream ciphers can allow attackers to break the cipher and recover plaintext.
  • An IV is a random value combined with the master key to create a unique key for each encryption.
  • The IV is sent along with the cipher text to allow decryption.
  • Example: WEP-encrypted wireless packets include the IV in plain text before the encrypted data.

Key Terms & Definitions

  • Symmetric key algorithm — Encryption and decryption use the same secret key.
  • Substitution cipher — Replaces plaintext components with ciphertext using a mapping.
  • Caesar cipher — A substitution cipher that shifts alphabet characters by a set offset.
  • ROT13 — A Caesar cipher with a key (offset) of 13; its own inverse.
  • Block cipher — Encrypts fixed-size blocks of data as single units.
  • Stream cipher — Encrypts data one unit (character/digit) at a time.
  • Initialization vector (IV) — Random data combined with a key to prevent key reuse in encryption.

Action Items / Next Steps

  • Review the differences between block and stream ciphers.
  • Understand how IVs are used to prevent key reuse.
  • Practice encrypting and decrypting messages using the Caesar and ROT13 ciphers.