Fiveable

๐Ÿ”Cryptography Unit 1 Review

QR code for Cryptography practice questions

1.2 Terminology and basic concepts

๐Ÿ”Cryptography
Unit 1 Review

1.2 Terminology and basic concepts

Written by the Fiveable Content Team โ€ข Last updated September 2025
Written by the Fiveable Content Team โ€ข Last updated September 2025
๐Ÿ”Cryptography
Unit & Topic Study Guides

Cryptography is all about keeping secrets safe. This section dives into the key terms and concepts you need to know, from plaintext and ciphertext to encryption keys and initialization vectors. It's like learning the alphabet before writing a novel.

We'll also explore different types of ciphers and encryption methods. Think of it as your cryptography toolbox โ€“ you'll learn when to use a hammer (stream cipher) versus a screwdriver (block cipher) to build secure systems.

Key Terms in Cryptography

Fundamental Cryptographic Concepts

  • Plaintext represents the original, readable message before encryption (email content)
  • Ciphertext emerges as the encrypted form of plaintext, appearing as scrambled characters (X#$%^&)
  • Encryption transforms plaintext into ciphertext using an algorithm and key
  • Decryption reverses encryption, converting ciphertext back to plaintext
  • Cryptographic key functions as a crucial piece of information for encryption/decryption (password)
  • Key space encompasses all possible keys for a specific encryption algorithm
    • Larger key spaces increase security by expanding possible combinations
    • 128-bit key space contains 21282^{128} possible keys
  • Key management involves secure handling of cryptographic keys throughout their lifecycle
    • Includes generation, distribution, storage, and destruction of keys
    • Crucial for maintaining overall system security

Advanced Cryptographic Terminology

  • Initialization Vector (IV) introduces randomness in encryption process
    • Unique value combined with the key for each encryption operation
    • Prevents identical plaintexts from producing identical ciphertexts
  • Nonce serves as a one-time use value in cryptographic operations
    • Similar to IV but typically incremented sequentially
    • Ensures uniqueness in stream ciphers and certain encryption modes
  • Salt adds random data to passwords before hashing
    • Protects against rainbow table attacks and password cracking attempts
    • Unique salt for each password increases difficulty of bulk password attacks
  • Message Authentication Code (MAC) verifies message integrity and authenticity
    • Calculated using the message and a secret key
    • Recipient can recalculate MAC to detect any modifications to the message

Substitution vs Transposition

Substitution Ciphers

  • Replace plaintext characters with other characters or symbols
  • Simple substitution uses fixed mapping between plaintext and ciphertext characters
    • Caesar cipher shifts each letter by a fixed number of positions (ROT13)
    • Atbash cipher reverses the alphabet (A becomes Z, B becomes Y)
  • Polyalphabetic substitution employs multiple substitution alphabets
    • Vigenรจre cipher uses a keyword to determine multiple Caesar ciphers
    • Provides stronger encryption than simple substitution
  • Homophonic substitution assigns multiple ciphertext characters to each plaintext character
    • Increases difficulty of frequency analysis attacks
    • Example: 'E' could be represented by 3, 7, or 9 in ciphertext

Transposition Ciphers

  • Rearrange order of plaintext characters without changing the characters themselves
  • Rail fence cipher writes plaintext in zigzag pattern, then reads off row by row
    • Example: "HELLO WORLD" becomes "HOLELWRDLO" with 3 rails
  • Columnar transposition arranges plaintext in grid, reads off columns in key-determined order
    • Key: 3142
    • Plaintext: HELLO WORLD
    • Grid:
      H E L L
      O W O R
      L D
      
    • Ciphertext: LOWDHELOLR
  • Route cipher follows specific path through grid to create ciphertext
    • Spiral path, alternating diagonals, or other patterns
  • Combining substitution and transposition increases cipher complexity and security
    • ADFGVX cipher uses both techniques for enhanced protection

Stream vs Block Ciphers

Stream Ciphers

  • Encrypt data one bit or byte at a time
  • Combine plaintext with pseudorandom keystream using bitwise XOR operations
  • Faster and require lower hardware resources
    • Suitable for real-time encryption (voice communication)
    • Efficient for resource-constrained devices (IoT sensors)
  • Require unique keystream for each message to maintain security
  • RC4 algorithm stands as a well-known stream cipher example
    • Used in older Wi-Fi encryption protocols (WEP, WPA)
  • Salsa20 and ChaCha20 represent modern, secure stream ciphers
    • Designed for high-speed software implementations

Block Ciphers

  • Encrypt fixed-size blocks of data (64 or 128 bits) at a time
  • Apply series of complex mathematical operations to each block
  • Generally more secure and versatile than stream ciphers
  • Allow various modes of operation for additional security properties
    • Electronic Codebook (ECB) encrypts each block independently
    • Cipher Block Chaining (CBC) XORs each block with previous ciphertext
    • Counter (CTR) mode turns block cipher into stream cipher
  • AES (Advanced Encryption Standard) stands as widely used block cipher
    • Supports 128, 192, and 256-bit key sizes
    • Adopted by U.S. government for classified information
  • Blowfish and Twofish serve as alternative block cipher algorithms
    • Designed as potential AES candidates

Confusion and Diffusion in Cryptography

Confusion Principle

  • Makes relationship between key and ciphertext as complex as possible
  • Obscures connection between input (plaintext and key) and output (ciphertext)
  • Achieved through substitution operations in modern ciphers
    • S-boxes (substitution boxes) in AES perform non-linear transformations
    • Each input bit affects multiple output bits in complex ways
  • Confusion properties:
    • Small changes in key result in significant ciphertext changes
    • Ciphertext bits depend on multiple key bits in a complex manner

Diffusion Principle

  • Spreads influence of each plaintext or key bit over much of ciphertext
  • Ensures changing one input bit affects many output bits
  • Implemented through transposition and permutation functions
    • AES MixColumns operation combines bytes within each column
    • Permutation step in DES rearranges bits after each round
  • Diffusion properties:
    • Statistical properties of plaintext dissipate into ciphertext
    • Patterns in plaintext become indistinguishable in ciphertext

Implementation in Modern Cryptography

  • Modern algorithms combine multiple rounds of confusion and diffusion
    • AES uses 10, 12, or 14 rounds depending on key size
    • Each round applies substitution (confusion) and permutation (diffusion) operations
  • Feistel network structure used in many block ciphers (DES, Blowfish)
    • Divides data block into two halves, applies function to one half
    • Alternates between halves in each round, combining confusion and diffusion
  • Avalanche effect demonstrates strength of confusion and diffusion
    • Small change in plaintext or key results in significantly different ciphertext
    • Ideal cipher exhibits 50% bit change probability for single input bit change