Foundations of Cryptography
Understand the core concepts, key terminology, cryptographic primitives, and the main types of cryptosystems in cryptography.
Summary
Read Summary
Flashcards
Save Flashcards
Quiz
Take Quiz
Quick Practice
How is cryptography defined in the context of secure communication?
1 of 19
Summary
Fundamentals of Cryptography
Understanding Cryptography
Cryptography is the practice and study of techniques that enable secure communication even when adversaries are present. Think of it as a way to protect information so that only the intended recipient can read it.
The primary purpose of cryptography is to construct and analyze protocols—specific communication procedures—that prevent third parties from reading private messages. More broadly, cryptography ensures four essential information-security properties:
Data confidentiality — keeping information private from unauthorized viewers
Data integrity — ensuring information hasn't been altered or corrupted
Authentication — verifying the identity of the person sending a message
Non-repudiation — preventing someone from denying they sent a message
These four properties form the foundation of why cryptography matters in practice.
Essential Terminology
To study cryptography effectively, you need to understand its core vocabulary. Let's build these concepts step by step.
Messages and Encryption Basics
Plaintext is readable, meaningful information—the original message you want to protect. It's the input to an encryption algorithm.
Ciphertext is the result of encrypting plaintext. It appears as unintelligible, scrambled text that looks meaningless to anyone who doesn't have the key.
Encryption is the process that converts plaintext into ciphertext. Decryption is the reverse process—it converts ciphertext back into plaintext so the intended recipient can read it.
Here's a simple example: If your plaintext is "HELLO", encryption might transform it into "KHOOR" (using a simple shift cipher). The ciphertext "KHOOR" means nothing to an eavesdropper, but decryption converts it back to "HELLO".
Keys and Ciphers
A key is a secret value—usually a string of characters or numbers—that is required to decrypt ciphertext. The key is what makes encryption secure; without it, decryption should be extremely difficult.
A cipher is a pair of algorithms: one for encryption and one for the corresponding decryption. The cipher is the mathematical method; the key is the secret parameter used with that method.
A cryptosystem is the complete ordered set of:
Possible plaintexts
Possible ciphertexts
Possible keys
The encryption and decryption algorithms associated with each key
Think of a cryptosystem as the entire package needed for secure communication.
Code vs. Cipher: An Important Distinction
Students often confuse codes and ciphers, but they're fundamentally different.
A code replaces a meaningful word or phrase with a code word. For example, a military might use "wallaby" as code for "attack at dawn". The replacement happens at the word level. Once someone knows the code book (the mapping of words to code words), they can decode messages.
A cipher substitutes or transforms elements below the word level—individual letters or pairs of letters. So "HELLO" might become "KHOOR" by shifting each letter. This transformation happens systematically to every character, not just replacing meaningful words.
The key difference: Codes work at the word level; ciphers work at the letter or sub-letter level.
Cryptanalysis
Cryptanalysis is the study of methods for obtaining the meaning of encrypted information without possessing the required key. Cryptanalysts try to break ciphers, find weaknesses, or recover plaintext from ciphertext. When security professionals design cryptosystems, they must consider what cryptanalysts might do to attack them.
Cryptographic Primitives
A cryptographic primitive is a basic algorithm that has fundamental security properties. These primitives are the building blocks of more complex cryptographic tools.
Two important types of primitives are:
Pseudorandom functions produce output that is indistinguishable from random noise to any efficient adversary. No efficient algorithm can predict the next output or detect a pattern, even though the function is actually deterministic (produces the same output for the same input).
One-way functions are easy to compute in one direction but hard to invert without special knowledge. For example, it might be easy to multiply two large prime numbers together, but extremely difficult to factor the result back into those primes without knowing them already.
The relationship between primitives and cryptosystems is hierarchical: more complex cryptographic tools and complete cryptosystems are constructed by combining one or more cryptographic primitives to achieve higher-level security goals like confidentiality or authentication.
Types of Cryptosystems
Cryptosystems fall into two main categories based on how they use keys. Understanding the difference is crucial.
Symmetric-Key Cryptosystems
In a symmetric-key cryptosystem, the same secret key is used for both encryption and decryption. Both parties must know the secret key, and they must keep it private.
In this diagram, Alice encrypts a message using a secret key, producing ciphertext. Bob decrypts it using the same secret key to recover the original message. If Eve intercepts the ciphertext without the key, she cannot read it.
Advantage: Symmetric systems are very fast—data manipulation happens much more quickly than in asymmetric systems. This makes them ideal for encrypting large amounts of data.
Challenge: Both parties must somehow share the secret key before they can communicate. How do they exchange the key securely if they're not in the same location?
Asymmetric-Key Cryptosystems
In an asymmetric-key cryptosystem (also called public-key cryptography), each person has two mathematically related keys: a public key and a private key.
The public key can be freely published and shared with anyone
The private key must be kept secret and never shared
Here's how it works: Alice publishes her public key so anyone can send her encrypted messages. When Bob wants to send Alice a message, he encrypts it using Alice's public key. Only Alice can decrypt it because only she has her private key. Importantly, Alice can decrypt messages encrypted with her public key, but she cannot use her public key to decrypt her own messages—only the private key works for that.
Advantage: There's no need for a pre-shared secret. Bob can send Alice an encrypted message immediately, even if they've never communicated before.
Disadvantage: Asymmetric systems are much slower than symmetric systems, making them impractical for encrypting large amounts of data.
Hybrid Systems: Getting the Best of Both Worlds
In practice, cryptographers use a hybrid approach:
First, asymmetric encryption is used to securely exchange a secret key between two parties
Then, that secret key is used for symmetric encryption to protect the bulk of the communication
This combines the security and convenience of asymmetric systems (no pre-shared secret needed) with the speed of symmetric systems (for encrypting large messages).
<extrainfo>
Historical Note: The image of an Enigma machine (img1) represents a famous historical cipher used during World War II. While interesting historically, understanding the Enigma machine specifically is not essential to mastering modern cryptography fundamentals.
</extrainfo>
Flashcards
How is cryptography defined in the context of secure communication?
The practice and study of techniques for secure communication in the presence of adversarial behavior.
What are the four central concepts of information security in cryptography?
Data confidentiality
Data integrity
Authentication
Non‑repudiation
What is the definition of plaintext in an encryption algorithm?
Readable information that is used as input.
What is ciphertext in the context of encryption?
Unintelligible text that results from encrypting plaintext.
What process is used to convert plaintext into ciphertext?
Encryption.
What process is used to convert ciphertext back into plaintext?
Decryption.
What constitutes a cipher?
A pair of algorithms that perform encryption and the corresponding decryption.
How does a cipher differ from a code regarding the level of transformation?
A cipher transforms elements below the word level (letters/pairs), whereas a code replaces entire words or phrases.
What components make up the ordered set of a cryptosystem?
Possible plaintexts
Possible ciphertexts
Possible keys
Encryption algorithms
Decryption algorithms
What is the goal of cryptanalysis?
To obtain the meaning of encrypted information without possessing the required key.
What are cryptographic primitives?
Basic algorithms possessing fundamental security properties like one-wayness or pseudorandomness.
How are complex cryptographic tools related to primitives?
They are constructed by combining one or more cryptographic primitives.
What defines a one-way function in cryptography?
A function that is easy to compute but hard to invert without special knowledge.
What is the defining characteristic of pseudorandom functions?
They produce output indistinguishable from random for any efficient adversary.
Which key(s) does a symmetric-key cryptosystem use for encryption and decryption?
The same secret key is used for both.
What is the primary speed advantage of symmetric systems over asymmetric systems?
Data manipulation is significantly faster.
How are keys assigned for encryption and decryption in asymmetric systems?
A public key is used for encryption and a mathematically related private key is used for decryption.
Why do asymmetric systems eliminate the need for a pre-shared secret?
Because the encryption key (public key) can be freely published.
How are asymmetric and symmetric algorithms typically combined in practice?
Asymmetric algorithms exchange a secret key, then symmetric encryption secures the bulk of communication.
Quiz
Foundations of Cryptography Quiz Question 1: Which statement correctly describes a symmetric‑key cryptosystem?
- It uses the same secret key for both encryption and decryption (correct)
- It uses a public key for encryption and a private key for decryption
- It requires no keys at all
- It encrypts data faster than it can decrypt it
Which statement correctly describes a symmetric‑key cryptosystem?
1 of 1
Key Concepts
Cryptographic Concepts
Cryptography
Cryptographic primitive
One‑way function
Pseudorandom function
Encryption Techniques
Encryption
Ciphertext
Symmetric‑key cryptosystem
Asymmetric‑key cryptosystem
Hybrid cryptosystem
Cryptanalysis
Cryptanalysis
Definitions
Cryptography
The study and practice of techniques for secure communication in the presence of adversaries.
Ciphertext
Unintelligible data produced by encrypting plaintext.
Encryption
The process of converting readable plaintext into ciphertext using a cryptographic algorithm.
Cryptographic primitive
Basic algorithmic building blocks, such as one‑way functions or pseudorandom functions, that provide fundamental security properties.
Symmetric‑key cryptosystem
A cryptographic system that uses the same secret key for both encryption and decryption.
Asymmetric‑key cryptosystem
A cryptographic system that employs a public key for encryption and a mathematically related private key for decryption.
Hybrid cryptosystem
A scheme that combines asymmetric encryption to exchange a secret key with symmetric encryption for bulk data protection.
Cryptanalysis
The discipline of analyzing encrypted data to recover the original information without the key.
One‑way function
A function that is easy to compute but computationally infeasible to invert without special knowledge.
Pseudorandom function
An efficiently computable function whose output is indistinguishable from random to any feasible adversary.