Fundamentals of Cryptography and Information Security

Master the fundamentals of cryptography and information security. This guide covers ciphers, attacks, randomness, and key concepts for students.

Podcast

Úvod do kryptografie0:00 / 14:25
0:001:00 remaining

Welcome to a comprehensive guide on the Fundamentals of Cryptography and Information Security, designed to provide students with a clear understanding of these essential concepts. This article breaks down core cryptographic principles, various attack models, and the critical role of randomness, ensuring you grasp the basics for your studies or exams.

Unpacking the Fundamentals of Cryptography and Information Security

Cryptography is both an art and a science focused on securing data against adversaries. It involves transforming data (plaintext) into an unintelligible form (ciphertext) using a critical parameter called a key. This process, known as encryption, provides data confidentiality, meaning only those with the correct key can access the original data's meaning.

Unlike simple encoding, which uses a known, fixed mapping, encryption uses a secret mapping defined by a secret key (K). Decryption is the inverse process, using a decryption key to recover the plaintext from ciphertext. The security of a system should not rely on the secrecy of its design details, a principle known as Kerckhoffs’ principle or Shannon's Maxim (the enemy knows the system).

Types of Cryptographic Algorithms

Cryptographic algorithms can be categorized based on their use of keys:

  • Algorithms with keys: These include ciphers (symmetric and asymmetric) and Message Authentication Codes (MACs).
  • Algorithms without keys (unkeyed): Examples are hash functions and Random Number Generators (RNGs).

Understanding Attacker Models and Goals

In information security, clearly defining what an attacker can and cannot do is crucial. Attackers have various goals, such as recovering plaintext, finding the key, or other sensitive information.

Attacker Models:

  • Passive Adversary: Observes and records information without altering it. Examples include ciphertext-only and known-plaintext attacks.
  • Active Adversary: Interacts with ongoing transmissions, injecting or altering data, or initiating new interactions with legitimate parties. Examples include chosen-plaintext and chosen-ciphertext attacks.

Common Attack Types:

  • Exhaustive Search (Brute Force): Trying all possible options, especially all possible keys, to find the correct one. This becomes infeasible with sufficiently large key sizes (e.g., over 100 bits).
  • Ciphertext-Only Attack: The adversary tries to recover plaintext or the key using only access to ciphertext.
  • Known-Plaintext Attack: The adversary has access to some ciphertext and its corresponding plaintext, trying to recover the key or decrypt further ciphertext.
  • Chosen-Plaintext Attack: The adversary can choose some plaintext and observe its corresponding ciphertext, allowing for advanced analysis.
  • Chosen-Ciphertext Attack: The adversary can provide ciphertext and receive its corresponding plaintext (for a fixed key) to deduce the secret key or other decryption information.

Countermeasures against these attacks often involve using large key sizes to make brute-force attacks infeasible and designing ciphers that produce random-looking ciphertext, making statistical attacks difficult.

Flashcards

1 / 41

What is the purpose of an Initialization Vector (IV) in symmetric encryption?

To randomize the ciphertext for the same key and plaintext so identical plaintexts encrypt to different ciphertexts (with same key).

Tap to flip · Swipe to navigate

Symmetric Encryption: Block vs. Stream Ciphers

Symmetric encryption schemes use the same key for both encryption and decryption. This is a fundamental concept in many modern secure communications.

Stream Ciphers

Stream ciphers encrypt data one bit or byte at a time. They are often deterministic Random Number Generators (RNGs) that produce a large keystream, initialized by a unique pair of a key (K) and an Initialization Vector (IV).

  • Characteristics: Extremely fast bitwise operations (XOR, AND, OR, shift). Widely used for hardware implementation and efficient for unknown file sizes or continuous streams (audio, video).
  • Examples: ChaCha20 is a common stream cipher. RC4 is known to be weak and has been dropped from TLS 1.3.
  • Vernam Cipher (One-Time Pad): A perfect cipher where the key is as long as the plaintext and used only once. This makes it theoretically unbreakable but highly impractical due to key distribution and management challenges.
  • Keystream Uniqueness: A crucial aspect. Reusing a keystream is a critical security flaw, as it allows attackers to potentially recover plaintext by XORing two ciphertexts encrypted with the same keystream ($CT_1 ext{ XOR } CT_2 = PT_1 ext{ XOR } PT_2$). The IV randomizes the ciphertext for the same key/plaintext pair and must be unique, though not necessarily random.

Block Ciphers

Block ciphers operate on fixed-size blocks of data, typically 64, 128, or 256 bits, transforming them through permutations. They are generally faster than stream ciphers and suitable for software implementation, allowing for parallel processing.

  • Padding: Since block ciphers require fixed-size blocks, incomplete last blocks must be padded. Various padding schemes exist (e.g., zero padding). The padding length is often indicated in the last byte to distinguish it from actual data.
  • Modes of Operation: Block ciphers have many versions or modes, some of which use an IV that must be unique.

Data Encryption Standard (DES)

DES was a widely used encryption scheme, evolving from IBM's LUCIPHER cipher. Standardized in 1977, it used 64-bit blocks with a 56-bit key. While groundbreaking, its 56-bit key length made it vulnerable to brute-force attacks over time, as demonstrated by the EFF DES-breaking machine in 1998.

  • Triple DES (3DES): A more secure variant that applies DES encryption, then decryption, then encryption again with three different keys ($K_1, K_2, K_3$). Often, $K_3 = K_1$, resulting in an effective key length of 112 bits, providing better security than single DES.

Advanced Encryption Standard (AES)

AES is the current standard for symmetric encryption, chosen in 2000 and standardized in 2001 (FIPS standard). It replaced DES due to its superior security and efficiency.

  • Key Lengths and Rounds: AES supports three key lengths, each with a specific number of rounds:
  • 128 bits (10 rounds)
  • 192 bits (12 rounds)
  • 256 bits (14 rounds)
  • Fixed Block Size: AES always uses a 128-bit block size.
  • Algorithm Building Blocks (Rijndael):
  1. Key Scheduling: The MasterKey is expanded into multiple RoundKeys.
  2. AddRoundKey: XORs the data with a RoundKey.
  3. SubBytes: A non-linear operation using an S-box (8-bit to 8-bit permutation).
  4. MixColumn & ShiftRows: Mixing operations that ensure the avalanche effect (small change in input leads to significant change in output).
  • Encryption vs. Decryption: Decryption uses the reversed order of RoundKeys and inverse operations.

The Critical Role of Randomness in Cryptography

Cryptography heavily relies on hard-to-guess and unique values for keys, Initialization Vectors (IVs), nonces, and challenges. These random values must be unpredictable and unique, ideally coming from a large pool.

Random Number Generators (RNGs)

  • Truly Random Number Generators (TRNGs): These are non-deterministic, drawing randomness from physical processes like radio decay or thermal noise. They are aperiodic but typically slow.
  • Pseudorandom Number Generators (PRNGs): These are deterministic software functions that are fast but periodic. They are initialized by a seed, which fully determines the sequence of

Sign up to access full content

Create a free account to unlock all study materials, take interactive tests, listen to podcasts and more.

Create free account

Related topics