Tutorial 2.1: Introduction to Cryptography and Security Services
Learning Objectives
After completing this tutorial, you should be able to:
- Define cryptography and explain its fundamental role in computer and network security.
- Describe the core security services—confidentiality, integrity, authentication, and non-repudiation—and explain how cryptography enables each.
- Analyze the differences between passive and active security attacks and identify real-world examples of each.
- Explain Kerckhoffs's Principle and evaluate its implications for cryptographic system design.
- Compare symmetric cryptography, asymmetric cryptography, and hash functions in terms of their purposes, mechanisms, and applications.
- Distinguish between security by obscurity and open design, and assess the advantages of the latter.
- Identify major cryptographic standards organizations and their roles in establishing secure cryptographic practices.
- Classify common real-world cryptographic applications and the security services they provide.
- Evaluate threat models and attack surfaces in the context of cryptographic system design.
- Analyze the relationships among security services and how they collectively contribute to a comprehensive security posture.
Overview
Welcome to Unit 2 of COMP400: Computer and Network Security. In this unit, we embark on a comprehensive exploration of cryptographic protocols, tools, and algorithms—the foundational building blocks upon which modern computer and network security is constructed. This first tutorial establishes the conceptual framework that will guide our journey through the remainder of the unit.
Cryptography, derived from the Greek words kryptos (hidden) and graphein (to write), is the art and science of secret writing. In the digital age, it has evolved far beyond its historical origins to become the mathematical and technical discipline that underpins virtually every aspect of information security. From the encryption that protects your online banking transactions to the digital signatures that authenticate software updates, from the secure hashing that verifies file integrity to the key exchange protocols that establish secure communication channels—cryptography is the silent guardian of the digital world.
This tutorial serves as the gateway to the cryptographic tools that form the heart of computer security. As Stallings and Brown note in Computer Security: Principles and Practice, cryptographic algorithms are "important element[s] in security services". Understanding these algorithms—and the principles that govern their design and use—is essential for any security professional.
Why This Tutorial Matters
The concepts introduced in this tutorial are not merely academic abstractions. They represent the conceptual foundation upon which all subsequent tutorials in this unit are built. Before we can understand the mechanics of the Advanced Encryption Standard (AES), the mathematics of RSA, or the protocols of TLS, we must first understand:
- What security services cryptography is designed to provide
- Why certain design principles are essential for cryptographic security
- How cryptographic systems are structured and analyzed
- Who establishes the standards that govern cryptographic practice
- Where cryptography is applied in the real world
Relationship to Previous and Upcoming Tutorials
This tutorial builds upon the foundational security concepts introduced in Unit 1 of COMP400, including the basic principles of computer security, threat modeling, and the overall security architecture. As you progress through this unit:
- Tutorial 2.2 will explore classical cryptography and historical systems, demonstrating how the principles introduced here were applied (and sometimes failed) in practice.
- Tutorial 2.3 will establish the mathematical foundations—number theory, modular arithmetic, and finite fields—that underlie modern cryptographic algorithms.
- Tutorials 2.4 through 2.17 will systematically cover symmetric encryption, public-key cryptography, hash functions, digital signatures, and cryptographic protocols, each building upon the conceptual framework established in this tutorial.
By the end of this tutorial, you will have developed a comprehensive mental model of cryptography as a discipline—its purposes, its principles, its building blocks, and its place within the broader landscape of computer and network security.
Core Concepts and Terminology
What Is Cryptography?
Cryptography is the practice and study of techniques for secure communication in the presence of adversaries. More formally, it is the discipline that encompasses the principles, methods, and means of transforming information to protect its content, prevent its unauthorized modification, and verify its origin.
The scope of modern cryptography extends well beyond traditional encryption to include:
- Confidentiality: Ensuring that information is accessible only to authorized parties
- Integrity: Ensuring that information has not been altered
- Authentication: Verifying the identity of parties or the origin of information
- Non-repudiation: Preventing denial of previous actions or communications
Cryptography is distinguished from cryptanalysis—the study of methods for defeating cryptographic protections—and together these two disciplines constitute cryptology.
Fundamental Cryptographic Terminology
Before proceeding, it is essential to establish a precise vocabulary. The following terms are foundational to all cryptographic discussions:
| Term | Definition |
| Plaintext | The original, readable form of a message or data |
| Ciphertext | The transformed, unreadable form of a message or data produced by encryption |
| Encryption | The process of transforming plaintext into ciphertext |
| Decryption | The process of transforming ciphertext back into plaintext |
| Cryptographic Algorithm (Cipher) | A mathematical function used for encryption and decryption |
| Key | A piece of information that controls the operation of a cryptographic algorithm |
| Key Space | The set of all possible keys for a given algorithm |
| Cryptosystem | The complete set of algorithms, protocols, and procedures that implement cryptographic security |
| Cryptographic Primitive | A low-level cryptographic algorithm used as a building block for higher-level protocols |
| Cryptographic Protocol | A sequence of steps involving cryptographic primitives to achieve a security goal |
The Cryptosystem Model
A general cryptosystem can be modeled using five fundamental components:
┌─────────────────────────────────────────────────────────────────┐
│ CRYPTOSYSTEM MODEL │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Sender Encryption Receiver │
│ ┌─────┐ ┌─────────┐ ┌─────┐ │
│ │Plain │──────────────►│ Cipher │───────────►│Plain│ │
│ │ text │ │Algorithm│ │ text│ │
│ └─────┘ └─────────┘ └─────┘ │
│ │ │ ▲ │
│ │ │ │ │
│ ▼ ▼ │ │
│ ┌─────┐ ┌─────────┐ ┌─────┐ │
│ │ Key │──────────────►│ Key │────────────┤ Key │ │
│ │(K ) │ │ Space │ │(K ) │ │
│ └──┬──┘ └─────────┘ └──┬──┘ │
│ │ │ │
│ └───────────────────┬─────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌───────────┐ │
│ │ Adversary │ │
│ └───────────┘ │
└─────────────────────────────────────────────────────────────────┘
Figure 1: The general cryptosystem model, showing the relationships among plaintext, ciphertext, encryption/decryption algorithms, keys, and the adversary.
Formally, a cryptosystem can be defined as a five-tuple:
(P, C, K, E, D)
where:
- P is the finite set of possible plaintexts
- C is the finite set of possible ciphertexts
- K is the finite set of possible keys (the key space)
- E = {Eₖ : k ∈ K} is the set of encryption functions, where Eₖ: P → C
- D = {Dₖ : k ∈ K} is the set of decryption functions, where Dₖ: C → P
For the cryptosystem to be correct, for every key k ∈ K and every plaintext p ∈ P:
Dₖ(Eₖ(p)) = p
That is, encryption followed by decryption with the same key must return the original plaintext.
Worked Example: The Caesar Cipher
To illustrate these concepts, consider the Caesar cipher—a simple substitution cipher where each letter is shifted by a fixed number of positions in the alphabet.
- Plaintext (P): All 26 uppercase letters {A, B, C, ..., Z}
- Ciphertext (C): All 26 uppercase letters {A, B, C, ..., Z}
- Key (K): An integer k ∈ {0, 1, 2, ..., 25}
- Encryption (Eₖ): Eₖ(p) = (p + k) mod 26
- Decryption (Dₖ): Dₖ(c) = (c - k) mod 26
For example, with k = 3:
- Plaintext: "HELLO"
- Encryption: H→K, E→H, L→O, L→O, O→R → Ciphertext: "KHOOR"
- Decryption: K→H, H→E, O→L, O→L, R→O → Plaintext: "HELLO"
Security Services and the CIA Triad
Security services are the fundamental objectives that cryptographic systems are designed to achieve. The most commonly referenced framework for security services is the CIA triad—Confidentiality, Integrity, and Availability. To these three, we add Authentication and Non-Repudiation to form the complete set of core security services.
Confidentiality
Confidentiality is the security service that ensures information is accessible only to authorized parties. It protects against unauthorized disclosure of information.
How cryptography provides confidentiality: Encryption transforms plaintext into ciphertext that can only be read by someone possessing the appropriate decryption key.
Examples of confidentiality requirements:
- Encrypting email messages so that only the intended recipient can read them
- Encrypting files stored on disk to protect against unauthorized access
- Encrypting network traffic to prevent eavesdropping
Limitations and considerations:
- Confidentiality does not address whether the information is authentic or has been modified
- Encryption alone does not protect against traffic analysis (observing patterns in communication)
- Key management is critical—if keys are compromised, confidentiality is lost
Integrity
Integrity is the security service that ensures information has not been altered in an unauthorized manner. It protects against modification, insertion, deletion, or replay of data.
How cryptography provides integrity: Cryptographic hash functions and message authentication codes (MACs) produce verification values that can detect any changes to the data.
Examples of integrity requirements:
- Verifying that a software download has not been tampered with
- Ensuring that financial transactions have not been modified in transit
- Detecting unauthorized changes to system configuration files
Limitations and considerations:
- Integrity alone does not guarantee confidentiality
- Integrity mechanisms must be combined with authentication to prevent forgery
- The strength of integrity protection depends on the strength of the underlying cryptographic primitives
Authentication
Authentication is the security service that verifies the identity of a user, system, or the origin of information. It answers the question: "Is this entity who or what it claims to be?"
Types of authentication:
| Type | Description | Cryptographic Mechanism |
| Entity Authentication | Verifying the identity of a communicating party | Challenge-response protocols, digital signatures, MACs |
| Data Origin Authentication | Verifying the source of a message | Digital signatures, MACs |
| Message Authentication | Verifying that a message came from the claimed source and has not been modified | MACs, digital signatures |
How cryptography provides authentication: Digital signatures, MACs, and challenge-response protocols provide cryptographic proof of identity.
Examples of authentication requirements:
- Logging into a system with a password (authenticating the user to the system)
- Verifying that an email was sent by the claimed sender
- Authenticating a web server to a browser during TLS handshake
Limitations and considerations:
- Authentication does not guarantee confidentiality
- Strong authentication requires secure key management and secure storage of authentication credentials
- Authentication can be compromised through key theft, side-channel attacks, or implementation flaws
Non-Repudiation
Non-repudiation is the security service that prevents an entity from denying previous actions or communications. It provides evidence that can be used to prove that a particular action occurred.
How cryptography provides non-repudiation: Digital signatures created with private keys provide cryptographic proof that a specific entity signed a specific message.
Examples of non-repudiation requirements:
- Proving that a user authorized a financial transaction
- Verifying that a contract was signed by a particular party
- Establishing that a message was sent by the claimed sender
Limitations and considerations:
- Non-repudiation requires strong identity binding (linking a private key to a specific entity)
- Non-repudiation depends on the security of the private key—if compromised, repudiation becomes possible
- Legal frameworks often define the evidentiary weight of cryptographic non-repudiation
Availability
Availability is the security service that ensures information and systems are accessible and usable when needed by authorized users. While cryptography is not the primary mechanism for ensuring availability, it plays a supporting role.
How cryptography supports availability:
- Cryptographic access controls prevent unauthorized denial of service through resource exhaustion
- Cryptographic integrity verification prevents corruption that could make data unavailable
- Cryptographic redundancy (secret sharing) can ensure availability even if some components fail
Examples of availability requirements:
- Ensuring that encrypted data remains decryptable even after hardware failures
- Preventing denial-of-service attacks that exploit cryptographic weaknesses
Relationships Among Security Services
The security services are not independent—they interact and depend on each other in important ways:
- Confidentiality + Integrity + Authentication = A complete security solution for data in transit
- Authentication + Non-Repudiation = Accountability for actions
- Integrity + Authentication = Assurance that data is both genuine and unmodified
- Confidentiality alone provides no protection against data modification
┌─────────────────────────────────────────────────────────────────┐
│ SECURITY SERVICES MAP │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ │
│ │ CIA Triad │ │
│ └──────┬──────┘ │
│ │ │
│ ┌─────────────────┼─────────────────┐ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────────┐ ┌─────────────┐ ┌─────────────────┐ │
│ │ Confidentiality│ │ Integrity │ │ Availability │ │
│ │ (Encryption) │ │ (Hashing, │ │ (Redundancy, │ │
│ │ │ │ MACs) │ │ Recovery) │ │
│ └─────────────────┘ └─────────────┘ └─────────────────┘ │
│ │ │ │ │
│ └─────────────────┼─────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────┐ │
│ │ Authentication │ │
│ │ + Non-Repudiation │ │
│ │ (Digital Signatures│ │
│ │ + PKI) │ │
│ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Figure 2: Relationships among core security services.
Threat Models and Security Attacks
What Is a Threat Model?
A threat model is a systematic description of the potential adversaries, their capabilities, their resources, their motivations, and the risks they pose to a system. A well-defined threat model is essential for designing effective cryptographic protections because it answers critical questions:
- Who are our adversaries?
- What can they do?
- What are they trying to achieve?
- What resources do they have?
- Where are they in relation to our systems?
Without a clear threat model, it is impossible to determine what level of cryptographic protection is appropriate or what attacks must be defended against.
Taxonomy of Security Attacks
Security attacks can be classified along several dimensions. The most fundamental distinction is between passive attacks and active attacks.
Passive Attacks
A passive attack is one in which the adversary monitors, intercepts, or observes information without modifying it. Passive attacks are characterized by:
- The adversary does not alter the system or its data
- The adversary's presence may be undetectable
- The goal is typically information gathering
Types of passive attacks:
| Type | Description | Example |
| Eavesdropping | Listening to communications | Wiretapping a network connection |
| Traffic Analysis | Analyzing communication patterns | Inferring relationships from metadata |
| Release of Message Content | Obtaining the actual data | Decrypting captured ciphertext |
Countermeasures: Encryption prevents the release of message content. Traffic padding and other techniques can obscure communication patterns.
Active Attacks
An active attack is one in which the adversary actively modifies, disrupts, or injects information into the system. Active attacks are characterized by:
- The adversary alters the system or its data
- The adversary's presence may be detectable
- The goal may be modification, disruption, or impersonation
Types of active attacks:
| Type | Description | Example |
| Masquerade | Pretending to be another entity | Session hijacking, identity theft |
| Replay | Repeating previously valid messages | Replaying an authentication token |
| Modification | Altering message content | Changing a transaction amount |
| Denial of Service | Disrupting system availability | Flooding a server with requests |
| Man-in-the-Middle | Intercepting and modifying communications | TLS interception |
Countermeasures: Authentication mechanisms prevent masquerade. Sequence numbers and timestamps prevent replay. Integrity mechanisms detect modification. Redundancy and filtering mitigate denial of service.
Attack Surfaces and Attack Trees
The attack surface of a system is the set of points at which an adversary can attempt to enter or extract data. In cryptographic systems, attack surfaces include:
- Network interfaces: The points at which encrypted data enters or leaves the system
- Cryptographic APIs: The interfaces through which cryptographic functions are invoked
- Key storage: The locations where cryptographic keys are stored
- Random number generators: The sources of entropy for key generation
- Side channels: Physical characteristics that leak information (timing, power consumption, electromagnetic emissions)
Attack trees provide a structured method for analyzing attack surfaces. They represent the various ways an adversary might achieve a goal, with AND/OR logic showing combinations of conditions required for success.
┌──────────────────┐
│ Compromise │
│ Encrypted Data │
└────────┬─────────┘
│
┌──────────────┼──────────────┐
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────┐ ┌─────────────────┐
│ Break │ │ Compromise │ │ Exploit │
│ Encryption │ │ Keys │ │ Implementation │
│ Algorithm │ │ │ │ Flaw │
└─────────────────┘ └─────────────┘ └─────────────────┘
Figure 3: Simplified attack tree for compromising encrypted data.
Fundamental Cryptographic Principles
Certain principles have guided the design and evaluation of cryptographic systems for over a century. Understanding these principles is essential for appreciating why cryptographic systems are designed as they are and for evaluating their security.
Kerckhoffs's Principle
In 1883, the Dutch cryptographer Auguste Kerckhoffs published six axioms for military cryptography in his seminal work La Cryptographie Militaire. The most famous of these axioms—now known as Kerckhoffs's Principle—states:
"A cryptographic system should be secure even if everything about the system, except the key, is public knowledge."
In modern terms: The security of a cryptographic system must depend only on the secrecy of the key, not on the secrecy of the algorithm.
Implications of Kerckhoffs's Principle:
- Public algorithms can be subjected to extensive peer review: When algorithms are public, cryptanalysts worldwide can analyze them, identify weaknesses, and suggest improvements. This process, known as public scrutiny, has been essential to the development of strong cryptographic standards.
- Key management is paramount: If the algorithm is public, all security concentrates on the key. This means key generation, distribution, storage, and destruction must be handled with extreme care.
- Security by obscurity is rejected: Relying on the secrecy of the algorithm (or any system design element) is considered fundamentally unsound.
- Algorithm replacement is straightforward: If a key is compromised, it can be changed without replacing the entire algorithm. If an algorithm is found to be weak, it can be replaced without compromising the keys.
Kerckhoffs's original six axioms (paraphrased in modern terms):
- The system must be practically, if not mathematically, unbreakable.
- The system must not require secrecy and should be able to fall into enemy hands without inconvenience.
- The key must be communicable and retainable without the aid of written notes.
- The system must be adaptable to telegraphic communications.
- The system must be portable and operable by a single person.
- The system must be easy to use and not require extensive mental effort.
Security by Obscurity Versus Open Design
Security by obscurity is the practice of relying on the secrecy of the design or implementation to provide security. This approach is widely considered unsound for several reasons:
- Secret designs cannot be properly analyzed: Fewer cryptanalysts examine the system, so weaknesses may remain undiscovered
- Secrets are difficult to maintain: Over time, details leak through reverse engineering, insider knowledge, or simple carelessness
- Once compromised, the system is broken: If the secret design is revealed, there is no remaining security
Open design, by contrast, aligns with Kerckhoffs's Principle and offers significant advantages:
- Public scrutiny strengthens security: The best cryptographic algorithms have been analyzed by thousands of experts
- Standards enable interoperability: Public algorithms can be implemented by multiple vendors
- Independence from vendor secrecy: Users are not locked into a single vendor's "secret" algorithm
Modern cryptographic practice universally embraces open design. The most widely used cryptographic algorithms—AES, RSA, SHA-256, ECDSA—are all fully specified in public standards.
The Cryptographic Key Concept
A cryptographic key is a piece of information that determines the output of a cryptographic algorithm. Keys are fundamental to cryptography because:
- Keys provide scalability: Instead of designing a new algorithm for every communication, we use a single algorithm with different keys
- Keys enable separation of algorithm and instance: The algorithm defines the transformation; the key selects the specific transformation
- Keys facilitate key management: Keys can be changed, revoked, and distributed independently of algorithms
Key properties:
| Property | Description | Importance |
| Randomness | Keys should be generated from a truly random or cryptographically secure source | Predictable keys are vulnerable to brute-force attacks |
| Length | Keys should be long enough to resist exhaustive search | Key length determines the effort required for brute-force attacks |
| Uniqueness | Keys should be unique to each context | Key reuse can lead to attacks |
| Secrecy | Keys must be protected from unauthorized disclosure | If the key is known, the security is broken |
Key space: The set of all possible keys for a given algorithm. The size of the key space determines the difficulty of brute-force attacks. For a key of length n bits, the key space has size 2ⁿ (assuming all bit patterns are valid keys).
Shannon's Maxims
Claude Shannon, the father of information theory, articulated several principles for cryptographic system design that remain relevant today:
Shannon's Maxim: "The enemy knows the system." This is essentially a restatement of Kerckhoffs's Principle, emphasizing that cryptographic security must not depend on keeping the algorithm secret.
Shannon's Principles of Confusion and Diffusion:
- Confusion: The relationship between the key and the ciphertext should be as complex as possible. Each bit of the key should affect many bits of the ciphertext. Confusion is typically achieved through substitution (S-boxes).
- Diffusion: The influence of each plaintext bit should be spread over many ciphertext bits. Changing one bit of plaintext should change approximately half the bits of ciphertext. Diffusion is typically achieved through permutation (P-boxes) and mixing operations.
Together, confusion and diffusion frustrate statistical cryptanalysis by making the relationship between plaintext, key, and ciphertext highly complex.
Cryptographic Algorithms: A High-Level Taxonomy
Cryptographic algorithms can be classified into several broad categories based on their purpose and mechanism. This tutorial provides a high-level overview; subsequent tutorials will cover each category in depth.
Symmetric (Secret-Key) Cryptography
Symmetric encryption uses the same key for both encryption and decryption.
- Characteristics: One key (shared secret); fast and efficient for bulk encryption; requires secure key distribution
- Examples: DES, Triple DES, AES, Blowfish, Twofish
- Applications: Bulk data encryption, file encryption, disk encryption
- Security services provided: Confidentiality (primary), some integrity (with appropriate modes)
Asymmetric (Public-Key) Cryptography
Asymmetric encryption uses a pair of keys: a public key for encryption and a private key for decryption.
- Characteristics: Two keys (public and private); slower than symmetric encryption; solves the key distribution problem
- Examples: RSA, ECC, ElGamal
- Applications: Key exchange, digital signatures, secure email
- Security services provided: Confidentiality (with public-key encryption), authentication (with digital signatures)
Hash Functions
Cryptographic hash functions produce a fixed-size output (hash value) from an arbitrary-size input.
- Characteristics: One-way (preimage resistance); collision-resistant; deterministic (same input → same output)
- Examples: SHA-1, SHA-2 (SHA-256, SHA-512), SHA-3
- Applications: Password storage, data integrity verification, digital signatures
- Security services provided: Integrity (primary), authentication (when combined with secrets)
Digital Signatures
Digital signatures provide authentication and non-repudiation using asymmetric cryptography.
- Characteristics: Signer uses private key to sign; anyone can verify with public key; provides non-repudiation
- Examples: RSA signature, DSA, ECDSA
- Applications: Software authentication, legal documents, certificates
- Security services provided: Authentication, non-repudiation, integrity
Cryptographic Protocols
Cryptographic protocols are sequences of steps involving cryptographic primitives to achieve specific security goals.
- Characteristics: Combine multiple cryptographic primitives; address security in distributed systems; specify message formats and ordering
- Examples: TLS/SSL, SSH, IPsec, Kerberos
- Applications: Secure web browsing, secure shell access, VPNs
- Security services provided: Varies by protocol (typically multiple services combined)
┌─────────────────────────────────────────────────────────────────┐
│ CRYPTOGRAPHIC ALGORITHM TAXONOMY │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ CRYPTOGRAPHIC ALGORITHMS │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌────────────────────┼────────────────────┐ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Symmetric │ │ Asymmetric │ │ Hash │ │
│ │ (Secret │ │ (Public │ │ Functions │ │
│ │ Key) │ │ Key) │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ DES, │ │ RSA, │ │ SHA-2, │ │
│ │ 3DES, │ │ ECC, │ │ SHA-3, │ │
│ │ AES │ │ ElGamal │ │ BLAKE2 │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Digital │ │
│ │ Signatures │ │
│ │ (RSA, DSA, │ │
│ │ ECDSA) │ │
│ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Figure 4: Taxonomy of cryptographic algorithms.
Standards and Standardization Bodies
Cryptographic standards are essential for interoperability, security, and widespread adoption. Several organizations play key roles in establishing and maintaining cryptographic standards.
NIST and FIPS
The National Institute of Standards and Technology (NIST) is a U.S. government agency that develops and promotes measurement standards, including cryptographic standards.
Federal Information Processing Standards (FIPS) are standards developed by NIST for use by U.S. federal government agencies. They are widely adopted by industry and organizations worldwide.
Key FIPS publications for cryptography:
| Standard | Description |
| FIPS 140-3 | Security Requirements for Cryptographic Modules |
| FIPS 180-4 | Secure Hash Standard (SHS) |
| FIPS 197 | Advanced Encryption Standard (AES) |
| FIPS 202 | SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions |
| FIPS 203 | Module-Lattice-Based Key-Encapsulation Mechanism Standard (ML-KEM) |
| FIPS 204 | Module-Lattice-Based Digital Signature Standard (ML-DSA) |
| FIPS 205 | Stateless Hash-Based Digital Signature Standard (SLH-DSA) |
NIST also publishes Special Publications (SP) that provide guidance on implementing cryptographic standards.
ISO/IEC Standards
The International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC) jointly develop international standards for many domains, including cryptography.
Key ISO/IEC standards for cryptography:
- ISO/IEC 9797: Message Authentication Codes (MACs)
- ISO/IEC 10118: Hash Functions
- ISO/IEC 14888: Digital Signatures
- ISO/IEC 18033: Encryption Algorithms
IETF and RFCs
The Internet Engineering Task Force (IETF) develops standards for the Internet through Request for Comments (RFC) documents.
Key IETF cryptographic standards:
- RFC 5246/8446: TLS (Transport Layer Security)
- RFC 4251-4254: SSH (Secure Shell)
- RFC 2104/6151: HMAC (Hash-based Message Authentication Code)
- RFC 2401-2412: IPsec
ANSI and IEEE
The American National Standards Institute (ANSI) and the Institute of Electrical and Electronics Engineers (IEEE) develop standards relevant to cryptography:
- ANSI X9: Financial services cryptography standards
- IEEE 1363: Standard specifications for public-key cryptography
Real-World Applications of Cryptography
Cryptography is pervasive in modern computing and communications. The following are representative applications that illustrate how cryptographic services are deployed in practice.
Secure Communications
TLS/SSL (Transport Layer Security/Secure Sockets Layer) provides secure communication over the internet. It uses:
- Symmetric encryption for bulk data confidentiality (AES-GCM, ChaCha20-Poly1305)
- Asymmetric cryptography for key exchange (RSA, ECDHE)
- Hash functions for integrity (SHA-2, SHA-3)
- Digital signatures for authentication (RSA, ECDSA)
Security services provided: Confidentiality, integrity, authentication (server and optional client)
Data at Rest
Full-disk encryption (e.g., BitLocker, FileVault, LUKS) protects data stored on disk:
- Symmetric encryption for bulk data (AES-XTS)
- Key derivation functions for password-based key generation
- Key management for secure storage of encryption keys
Security services provided: Confidentiality, some integrity
Authentication and Identity Management
Password-based authentication uses cryptographic hash functions:
- Passwords are hashed and stored (never stored in plaintext)
- Salt is added to prevent rainbow table attacks
- Key derivation functions (PBKDF2, bcrypt, Argon2) slow down brute-force attempts
Security services provided: Authentication (with some confidentiality of credentials)
E-Commerce and Financial Transactions
Payment systems (credit cards, digital wallets) rely on cryptography:
- Symmetric encryption for transaction confidentiality
- Digital signatures for transaction authentication and non-repudiation
- PKI for identity verification
Security services provided: Confidentiality, integrity, authentication, non-repudiation
Blockchain and Cryptocurrency
Blockchain systems (Bitcoin, Ethereum) use cryptography extensively:
- Hash functions for block chaining and proof-of-work
- Digital signatures (ECDSA) for transaction authorization
- Public-key cryptography for address generation
Security services provided: Integrity, authentication, non-repudiation (some confidentiality)
Case Study: The Evolution of Modern Cryptography
The Data Encryption Standard (DES) and the Birth of Public Cryptography
The evolution of modern cryptography illustrates many of the principles discussed in this tutorial. Two developments in the 1970s transformed cryptography from a classified military discipline into a public scientific field:
1. The Data Encryption Standard (1977)
In 1973, the U.S. National Bureau of Standards (now NIST) issued a public call for a standard encryption algorithm. IBM submitted a cipher developed by Horst Feistel, which became the basis for DES. DES was:
- The first publicly available encryption standard
- Subject to public scrutiny (though its S-boxes were classified initially)
- A 56-bit symmetric cipher that remained secure against practical attacks until the late 1990s
DES exemplified Kerckhoffs's Principle by publishing the algorithm while relying on the secrecy of the key. The 56-bit key space of 2⁵⁶ ≈ 7.2 × 10¹⁶ possible keys was sufficient at the time but eventually became vulnerable to brute-force attacks.
2. Public-Key Cryptography (1976-1977)
In 1976, Whitfield Diffie and Martin Hellman published "New Directions in Cryptography," introducing the concept of public-key cryptography and the Diffie-Hellman key exchange. In 1977, Ron Rivest, Adi Shamir, and Leonard Adleman developed the RSA algorithm.
Public-key cryptography solved the key distribution problem that had plagued symmetric cryptography: how to securely share keys without a pre-existing secure channel.
Lessons from the case study:
- Public scrutiny works: DES was extensively analyzed, leading to improvements and eventual replacement with AES
- Standards drive adoption: DES became the de facto standard for encryption worldwide
- Key length matters: DES's 56-bit key became inadequate as computational power increased
- Innovation continues: The transition from DES to AES to post-quantum cryptography demonstrates the ongoing evolution of cryptographic practice
Key Takeaways and Section Summaries
Core Concepts and Terminology
- Cryptography is the science of securing communication in the presence of adversaries.
- A cryptosystem consists of plaintext, ciphertext, keys, and encryption/decryption algorithms.
- The fundamental correctness condition is Dₖ(Eₖ(p)) = p for all keys and plaintexts.
Security Services
- Confidentiality: Protection against unauthorized disclosure (provided by encryption).
- Integrity: Protection against unauthorized modification (provided by hashing and MACs).
- Authentication: Verification of identity or origin (provided by digital signatures and MACs).
- Non-Repudiation: Prevention of denial of actions (provided by digital signatures).
- Availability: Ensuring accessibility when needed (supported by cryptographic redundancy).
Threat Models and Attacks
- A threat model defines adversaries, their capabilities, and their goals.
- Passive attacks observe without modifying (eavesdropping, traffic analysis).
- Active attacks modify or disrupt (masquerade, replay, modification, DoS, MITM).
- Attack surfaces and attack trees help identify vulnerabilities.
Fundamental Principles
- Kerckhoffs's Principle: Security must depend only on key secrecy, not algorithm secrecy.
- Security by obscurity is rejected; open design is preferred.
- Keys must be random, sufficiently long, unique, and secret.
- Shannon's confusion and diffusion frustrate cryptanalysis.
Cryptographic Taxonomy
- Symmetric: One key; fast; for confidentiality.
- Asymmetric: Two keys; slower; for key exchange and signatures.
- Hash functions: One-way; for integrity.
- Digital signatures: For authentication and non-repudiation.
- Protocols: Combine primitives for comprehensive security.
Standards and Applications
- NIST/FIPS, ISO/IEC, IETF, ANSI, and IEEE establish cryptographic standards.
- Cryptography is applied in secure communications (TLS), data at rest (disk encryption), authentication, e-commerce, and blockchain.
Quiz
- What is the fundamental difference between a passive attack and an active attack?
Answer
A passive attack involves monitoring or observing information without modifying it (e.g., eavesdropping, traffic analysis), while an active attack involves modifying, disrupting, or injecting information into the system (e.g., masquerade, replay, modification, denial of service).
- State Kerckhoffs's Principle in your own words.
Answer
Kerckhoffs's Principle states that a cryptographic system should remain secure even if everything about the system—except the key—is public knowledge. The security must depend only on the secrecy of the key, not on the secrecy of the algorithm.
- Which security service is primarily provided by encryption, and which service requires digital signatures for non-repudiation?
Answer
Encryption primarily provides confidentiality. Non-repudiation requires digital signatures (or other mechanisms that provide cryptographic proof of origin).
- What are the five components of a formal cryptosystem model?
Answer
The five components are: P (plaintext space), C (ciphertext space), K (key space), E (set of encryption functions), and D (set of decryption functions). The cryptosystem is formally defined as the five-tuple (P, C, K, E, D).
- Explain why "security by obscurity" is considered an unsound approach to cryptographic security.
Answer
Security by obscurity relies on keeping the design or implementation secret. This is unsound because: (1) secret designs cannot be properly analyzed by the cryptographic community; (2) secrets are difficult to maintain over time; (3) once the secret is revealed, there is no remaining security. Open design allows public scrutiny, which strengthens security.
- What security services does the CIA triad comprise, and what additional services are commonly included?
Answer
The CIA triad comprises Confidentiality, Integrity, and Availability. Authentication and Non-Repudiation are commonly included as additional core security services.
- A cryptographic system uses a 128-bit key. How many possible keys are in the key space (assuming all bit patterns are valid)?
Answer
The key space has 2¹²⁸ possible keys, which is approximately 3.4 × 10³⁸ possible keys.
- What is the difference between entity authentication and data origin authentication?
Answer
Entity authentication verifies the identity of a communicating party (e.g., a user logging into a system). Data origin authentication verifies the source of a specific message or piece of data (e.g., confirming that an email came from the claimed sender).
- Name three major cryptographic standards organizations and one standard each has published.
Answer
Examples: NIST (FIPS 197 AES), ISO/IEC (ISO/IEC 18033 Encryption Algorithms), IETF (RFC 8446 TLS 1.3).
- What do Shannon's concepts of confusion and diffusion refer to in cryptographic design?
Answer
Confusion refers to making the relationship between the key and the ciphertext as complex as possible (typically achieved through substitution or S-boxes). Diffusion refers to spreading the influence of each plaintext bit over many ciphertext bits (typically achieved through permutation or mixing operations). Together they frustrate statistical cryptanalysis.
Exercises
- Analyzing Security Services
For each of the following scenarios, identify which security service(s) are primarily being provided and explain why:
- Encrypting a file before storing it on a cloud service.
- Using a digital signature to sign a software update.
- Using a hash function to verify that a downloaded file matches the published checksum.
- Using a password to log into a banking website.
- Using a TLS connection for online shopping.
Sample Solution
- Confidentiality: Encryption prevents unauthorized parties from reading the file contents if they gain access to the cloud storage.
- Authentication and Non-Repudiation: The digital signature verifies that the update came from the legitimate software vendor (authentication) and provides evidence that the vendor signed it (non-repudiation).
- Integrity: Comparing the computed hash with the published checksum verifies that the file has not been modified during download.
- Authentication: The password verifies the user's identity to the banking system (entity authentication).
- All four core services: TLS provides confidentiality (encryption), integrity (MAC), authentication (server certificate), and non-repudiation (if client certificates are used).
- Threat Model Analysis
Consider a system that transmits encrypted financial transactions between a bank and its customers. Identify:
- At least three potential adversaries and their motivations.
- At least two passive attacks that could be attempted.
- At least three active attacks that could be attempted.
- What cryptographic services would be needed to defend against these attacks?
Sample Solution
- Potential adversaries: (1) A cybercriminal seeking to steal money or account information; (2) A competitor seeking intelligence on the bank's customers; (3) A nation-state actor seeking to disrupt the financial system.
- Passive attacks: (1) Eavesdropping on network traffic to capture transaction details; (2) Traffic analysis to identify patterns in customer behavior.
- Active attacks: (1) Man-in-the-middle to intercept and modify transactions; (2) Replay attack to repeat a valid transaction; (3) Masquerade to impersonate a legitimate customer or bank.
- Required cryptographic services: Confidentiality (encryption of transactions), integrity (to detect modification), authentication (to verify bank and customer identities), non-repudiation (to prevent denial of transactions).
- Kerckhoffs's Principle Application
You are asked to evaluate two proposed cryptographic systems:
- System A: Uses a well-known, publicly analyzed algorithm (AES) with a 256-bit key.
- System B: Uses a proprietary, secret algorithm designed by the company's engineering team with a 128-bit key.
Which system would you recommend and why? Evaluate both systems in terms of Kerckhoffs's Principle and practical security considerations.
Sample Solution
Recommendation: System A is strongly preferred.
Evaluation of System A: System A follows Kerckhoffs's Principle—the algorithm (AES) is public and has been extensively analyzed by the cryptographic community for decades. The security depends entirely on the 256-bit key, which provides a key space of 2²⁵⁶—effectively impossible to brute-force with current technology. The algorithm has withstood extensive cryptanalysis.
Evaluation of System B: System B relies on security by obscurity—the algorithm is secret. This violates Kerckhoffs's Principle. The 128-bit key may be adequate, but we cannot know if the algorithm has weaknesses because it has not been subjected to public scrutiny. If the algorithm is ever reverse-engineered or leaked, the entire security collapses.
Conclusion: System A is the more secure choice because it relies on well-understood, publicly analyzed cryptography with a strong key, whereas System B's security depends on keeping the algorithm secret—a fundamentally unsound approach.
- Cryptosystem Model
Define a formal cryptosystem for the Caesar cipher with shift k. Identify P, C, K, E, and D. Then encrypt the message "SECURITY" with k = 5 and decrypt the resulting ciphertext.
Sample Solution
Formal cryptosystem:
- P = {A, B, C, ..., Z} (all uppercase letters)
- C = {A, B, C, ..., Z} (all uppercase letters)
- K = {0, 1, 2, ..., 25}
- Eₖ(p) = (p + k) mod 26, where p is the numeric position of the plaintext letter (A=0, B=1, ..., Z=25)
- Dₖ(c) = (c - k) mod 26
Encryption with k = 5:
S=18→(18+5) mod 26=23→X
E=4→(4+5) mod 26=9→J
C=2→(2+5) mod 26=7→H
U=20→(20+5) mod 26=25→Z
R=17→(17+5) mod 26=22→W
I=8→(8+5) mod 26=13→N
T=19→(19+5) mod 26=24→Y
Y=24→(24+5) mod 26=29 mod 26=3→D
Ciphertext: "XJHZNWYD"
Decryption verification: X(23)→(23-5) mod 26=18→S, J(9)→(9-5) mod 26=4→E, etc. Returns "SECURITY".
- Attack Classification
Classify each of the following as a passive attack, an active attack, or both. Justify your classification.
- An attacker intercepts and records encrypted network traffic to analyze later.
- An attacker inserts a false message into a communication stream.
- An attacker observes that a particular user sends large amounts of data at the same time every day.
- An attacker modifies the contents of a message before it reaches the recipient.
- An attacker replays a previously captured authentication token to gain access.
Sample Solution
- Passive attack: The attacker is only intercepting and recording—no modification of the system or data occurs. This is eavesdropping.
- Active attack: Inserting a false message involves modifying the communication stream. This is an injection/modification attack.
- Passive attack: Observing communication patterns without modifying anything is traffic analysis.
- Active attack: Modifying message content is an active modification attack.
- Active attack: Replaying a previously valid message to gain unauthorized access is an active replay attack—the attacker is actively using the captured token to interact with the system.
Homework
- Security Services Analysis
Research a real-world security breach that involved the failure of one or more cryptographic security services. Write a one-page analysis that identifies:
- Which security service(s) failed
- How cryptography was (or should have been) involved
- What lessons can be learned from the breach
Sample Answer
Note: A complete answer would identify a specific breach such as the Heartbleed bug (failure of confidentiality and integrity in TLS), the Equifax breach (failure to encrypt sensitive data—confidentiality), or the Stuxnet attack (failure of integrity in industrial control systems). The analysis should demonstrate understanding of which security services were compromised and how proper cryptographic controls could have mitigated the breach.
- Threat Model Development
Develop a threat model for a small e-commerce website that processes credit card payments. Include:
- Identification of assets requiring protection
- Identification of potential adversaries
- Description of likely attack vectors
- Recommended cryptographic countermeasures for each identified threat
Sample Answer
Assets: Customer credit card numbers, customer personal information (name, address), transaction records, website credentials.
Adversaries: Cybercriminals seeking financial gain, competitors seeking customer data, insiders with access to systems.
Attack vectors: Network eavesdropping on payment transactions, SQL injection to extract database contents, man-in-the-middle attacks on customer connections, phishing to obtain customer credentials.
Cryptographic countermeasures: TLS for all communications (confidentiality and integrity), encryption of stored credit card data (confidentiality), strong hashing of passwords (integrity/authentication), digital signatures for transaction authorization (non-repudiation), secure key management for all cryptographic keys.
- Cryptosystem Design
Design a simple cryptosystem for a scenario where two parties, Alice and Bob, need to communicate securely over an insecure channel. Specify:
- The security services your system provides
- The cryptographic primitives you would use
- The key management approach
- Any assumptions or limitations
Sample Answer
Security services: Confidentiality, integrity, and authentication.
Cryptographic primitives: AES for symmetric encryption (confidentiality), HMAC-SHA256 for integrity and authentication, RSA for key exchange.
Key management: Alice and Bob each have RSA key pairs. They exchange public keys. For each session, they use RSA to exchange a random session key, then use AES with that session key for bulk encryption. HMAC is computed with a separate key derived from the session key.
Assumptions: Public keys are authentic (requires PKI or out-of-band verification). Both parties have secure random number generation. The implementation correctly uses the cryptographic primitives.
- Kerckhoffs's Principle Essay
Write a 500-word essay on the importance of Kerckhoffs's Principle in modern cryptography. Your essay should address:
- The historical context of Kerckhoffs's work
- Why the principle remains relevant today
- How the principle is reflected in modern cryptographic standards
- Counterarguments or limitations of the principle
Sample Answer
A complete answer would discuss how Kerckhoffs published his six axioms in 1883 for military cryptography; explain that the principle ensures that cryptographic algorithms can be openly analyzed and vetted; note that all modern standards (AES, SHA, RSA) are public; and acknowledge that while the principle is foundational, some argue that in certain contexts (e.g., military or classified systems), keeping some design elements secret may provide defense-in-depth. However, the essay should conclude that open design remains the standard for civilian and most government cryptography.
- Comparative Analysis
Compare and contrast symmetric cryptography and asymmetric cryptography in terms of:
- Key management requirements
- Computational efficiency
- Security services provided
- Typical use cases
- Key length requirements for equivalent security
Sample Answer
| Feature | Symmetric Cryptography | Asymmetric Cryptography |
| Key management | Requires secure key distribution; n(n-1)/2 keys for n parties | Each party has one key pair; n public keys and n private keys |
| Computational efficiency | Very fast; suitable for bulk encryption | Slow; not suitable for bulk encryption |
| Security services | Confidentiality (primary), some integrity | Confidentiality, authentication, non-repudiation |
| Use cases | Bulk data encryption, file encryption, disk encryption | Key exchange, digital signatures, secure email |
| Key length for equivalent security | 128-bit key (AES-128) ≈ 3072-bit RSA | 3072-bit RSA ≈ 128-bit symmetric security |
Summary
This tutorial has established the conceptual foundation for your study of cryptographic protocols, tools, and algorithms. We began by defining cryptography as the science of secure communication and introduced the formal cryptosystem model consisting of plaintext, ciphertext, keys, and encryption/decryption functions.
We explored the core security services that cryptography provides: confidentiality through encryption, integrity through hashing and MACs, authentication through digital signatures and MACs, and non-repudiation through digital signatures. We also examined the CIA triad and the relationships among these services.
The tutorial introduced threat models and the taxonomy of security attacks, distinguishing between passive attacks (eavesdropping, traffic analysis) and active attacks (masquerade, replay, modification, denial of service). We discussed the importance of understanding attack surfaces and using attack trees for systematic vulnerability analysis.
We examined fundamental cryptographic principles, most notably Kerckhoffs's Principle—the foundational insight that security must depend on key secrecy, not algorithm secrecy. We contrasted security by obscurity with open design and discussed Shannon's concepts of confusion and diffusion.
We provided a high-level taxonomy of cryptographic algorithms: symmetric (secret-key) cryptography, asymmetric (public-key) cryptography, hash functions, and digital signatures. We reviewed the major standards organizations—NIST, ISO/IEC, IETF, ANSI, and IEEE—and their roles in establishing cryptographic standards. Finally, we surveyed real-world applications of cryptography and examined a case study on the evolution of modern cryptography.
Connection to the Next Tutorial
In Tutorial 2.2: Classical Cryptography and Historical Systems, we will explore the historical development of cryptographic techniques, from ancient substitution ciphers through the mechanical cipher machines of World War II. This historical perspective will illustrate many of the principles introduced here and will demonstrate how cryptanalysis has driven the evolution of cryptographic design. Understanding historical systems provides essential context for appreciating the sophistication of modern cryptographic algorithms.