Security Protocols - Chapter 7
Course: ECM2426: Network and Computer Security
Chapter: 7 - Security Protocols
Author: Achim D. Brucker
Email: a.brucker@exeter.ac.uk
Website: https://brucker.ch/
Affiliation: Software Assurance & Security Research, Department of Computer Science, University of Exeter
Version: 1.0
Source: 2025-ecm2426-handout_chapter-07_security-protocols.pdf
Generated on: Mon Oct 20 16:49:27 BST 2025
Table of Contents
- Motivation
- Designing a Key-Establishment Protocol
- Notation Used in Protocol Modeling
- Attacks on Security Protocols
Changelog
- Initial release
1. Motivation
Why Security Protocols Matter
Cryptographic Primitives vs. Secure Applications:
- RSA, AES, etc. provide (probably) very good cryptographic primitives
- Challenge: How can we construct secure distributed applications with these primitives?
Applications Requiring Security Protocols
- E-commerce - Secure online transactions
- E-banking - Financial transaction security
- E-voting - Electoral integrity and privacy
- Mobile communication - Secure mobile networks
- Digital contract signing - Legal document authentication
Key Insight
Even if cryptography is hard to break, constructing secure distributed applications is not a trivial task.
2. Case Study: Needham-Schroeder Public Key Protocol (NSPK)
Problem: Establishing an Authentic Channel
Scenario: Alice wants to be sure that she talks to Bob (authenticity)
Alice ←--→ Eve ←--→ Bob
The NSPK Protocol (1978)
Needham and Schroeder proposed the following protocol:
Message Flow:
-
- “I am Alice and here is my nonce .”
-
- “Here is your nonce and I have one for you.”
-
- “I got it! It is .”
Definition: A Nonce (short for: number used once) is a fresh secret only known to the person generating it.
Correctness Analysis
Goal: Mutual Authentication (Two-way Authentication)
After executing the protocol successfully, Alice and Bob can be sure to talk to each other (and not to somebody else).
Correctness Argument (Informal):
-
Step 1:
- “This is Alice and I have chosen a nonce .”
-
Step 2:
- “Here is your nonce . Since I could read it, I must be Bob.”
- “I also have a challenge for you.”
-
Step 3:
- “You sent me . Since only Alice can read this and I sent it back, I must be Alice.”
Attack Scenario: Man-in-the-Middle
Let’s examine what happens with an attacker Eve:
Alice ←--→ Eve ←--→ Bob
Attack Flow:
- (Alice thinks she’s talking to Bob)
- (Eve responds with her own nonce)
- (Alice completes the protocol with Eve)
Result: Alice thinks she established a secure channel with Bob, but actually established one with Eve!
3. Security Protocol Definitions
Definition: Protocol
A protocol consists of a set of rules (conventions) that determine the exchange of messages between two or more principals.
In short, a distributed algorithm with emphasis on communication.
Definition: Security Protocol
Security (or cryptographic) protocols use cryptographic mechanisms to achieve security objectives, such as:
- Entity authentication - Verifying the identity of communicating parties
- Message authentication - Ensuring message integrity and origin
- Key establishment - Securely distributing cryptographic keys
- Integrity - Ensuring data hasn’t been tampered with
- Timeliness - Preventing replay attacks
- Fair exchange - Ensuring both parties receive what they expect
- Non-repudiation - Preventing denial of actions
Note: Implementing/designing security protocols can sometimes feel like programming Satan’s computer…
4. Designing a Key-Establishment Protocol
Problem Statement
Scenario Overview:
Let’s design a good security protocol from first principles!
Communication Architecture:
- A set of users, any two of whom may wish to establish a new session key for subsequent secure communications
- Successful completion of key establishment (& entity authentication) is only the start
- Further communication may be based on this established key
- Important: Users are not necessarily honest!
Server Requirements:
- An honest server (often called “trusted server”, but trust ≠ honesty!)
- We assume that an honest server never cheats and never gives out secrets of users
The Details
Protocol Roles:
- Initiator role (Alice)
- Responder role (Bob)
- Server role
Agents vs. Roles:
- In a concrete execution of a protocol, roles are played by agents (principals): (Charly), , …
- We use as the name of the intruder
- Important: No agent in our model knows that is not honest
Protocol Aims:
- At the end of the protocol, should be known to and
- Possibly known to (who forgets it immediately), but to no other parties
- and can assume that is newly generated
A ←--→ S ←--→ B
Formalization Questions (for later consideration):
- How do we formalize the protocol steps and goals?
- How do we formalize “knowledge”, “secrecy”, “newly”, etc.?
5. First Attempt at Key Establishment
Specification
Our first attempt consists of three messages:
-
- contacts by sending the identities of the two parties who are going to share the session key
-
- sends the key to
-
- passes on to
Message Flow:
A ←--→ S ←--→ B
1) A,B →
2) ← K_{AB}
3) K_{AB}, A →
Note: does not contain any “information” about or , but is simply a name for the bit-string representing the session key.
Specification Discussion
This is a significantly incomplete protocol specification:
Limitations:
-
Only successful runs specified
- No description of what happens when a message of wrong format is received
- No description when no message is received at all
- This is often done for security protocols, since error messages are often not relevant for security
-
No specification of internal actions
- e.g., “create fresh ” and store that it is a key for and
- and “know” that received messages are part of the protocol
- Common to omit details required for networked computer implementation
More Specification Details
Additional Considerations:
- Details of which key should be used to decrypt a received message which has been encrypted
- Tracking the progress of a particular protocol run
Note: Despite its limitations, specifying protocols by showing only the messages of a successful run remains the most popular method of describing security protocols.
Alternative Notation: Alice & Bob Notation
Equivalent representation:
Important Notes:
- Sender/receiver names (e.g., "") are not part of messages
- Messages do not automatically reach their destination (securely)
6. First Problem: Security Analysis
The Issue
Question: This protocol is not secure. What is the problem?
The session key must be transported to and but to no other parties.
Security Assumption 1
Definition: The intruder is able to eavesdrop on all messages sent in a security protocol.
Message Flow (with eavesdropping):
A ←--→ S ←--→ B
↓ ↓ ↓
Intruder can see all messages
Analysis:
- ✓ (No sensitive data)
- ❌ (Key exposed!)
- ❌ (Key exposed again!)
Problem: The intruder can read from messages 2 and 3, completely compromising the protocol.
7. Second Attempt: Using Pre-shared Keys
Specification with Encryption
Let us assume that initially shares a secret key with each user of the system:
- with
- with
Improved Protocol:
Improvement: uses the pre-shared keys to encrypt the message in step 2. Eavesdropping is no longer possible.
Perfect Cryptography Assumption
Definition: Encrypted messages may only be read by the legitimate recipients who have the keys required to decrypt them.
Message Flow (with encryption):
A ←--→ S ←--→ B
1) A,B →
2) ← {K_{AB}}_{sk(A,S)}, {K_{AB}}_{sk(B,S)}
3) {K_{AB}}_{sk(B,S)}, A →
Problems with Second Attempt
Issue: The protocol is (still) not secure. What is the problem?
The information about who else has is not protected. The intruder could capture messages and alter them.
Security Assumption 2
Definition: The intruder is able to intercept messages on the network and send messages to anybody (under any sender name).
In other words: The intruder has complete control over the network.
Worst-case scenario:
- Although there may be no more than 4 or 5 messages involved in a legitimate run of the protocol
- There are an infinite number of variations in which the intruder can participate
- These variations involve an unbounded number of messages
- Each must satisfy the protocol’s security requirements
Attack 1: Identity Substitution
Simple Attack:
The intruder simply intercepts the message from to and substitutes for ‘s identity ( is any agent name).
Attack Flow:
- (intercepted)
3’. (altered)
Result: believes that they are sharing the key with , whereas in fact they are sharing it with .
Assessment:
- Severity depends on the scenario, but may include giving away information to which should have been shared only with
- Although does not obtain , we can still regard the protocol as broken since it does not satisfy the requirement that users should know who else knows the session key
Attack 2: Key Redirection
More Serious Attack:
alters the message from to so that generates a key for and , and encrypts it with the key .
Attack Flow:
- (intercepted)
1’. (altered request)
Problem: Since cannot distinguish between encrypted messages and , will accept the key thinking it’s for communication with .
Result: The intruder now shares a key with , while believes the key is for communication with .
8. Protocol Notation and Modeling
Standard Notation Elements
Message Components:
- Principals: (Alice, Bob, Server)
- Keys: (shared key), (secret key between A and S)
- Nonces: (fresh random numbers)
- Encryption: (message M encrypted with key K)
Message Transmission:
- means “A sends message M to B”
- means “A receives message M from B”
Security Assumptions Summary
- Eavesdropping: Intruder can read all network traffic
- Active Attacks: Intruder can intercept, alter, and inject messages
- Perfect Cryptography: Only key holders can decrypt messages
- Network Control: Intruder has complete control over the network
Common Attack Patterns
- Man-in-the-Middle: Intercepting and relaying communications
- Identity Substitution: Changing sender/receiver identities
- Key Redirection: Forcing key establishment with attacker
- Replay Attacks: Reusing old messages
- Parallel Session Attacks: Using multiple protocol runs
Mathematical Notation Reference
Common Symbols Used
- - Agents (Alice, Bob, Server)
- - Session key between A and B
- - Pre-shared secret key between A and S
- - Nonces (numbers used once)
- - Message M encrypted with key K
- - Message transmission
- - Intruder/Attacker
Protocol Notation
- means “A sends message M to B”
- Messages can be intercepted, altered, or blocked by attackers
- Perfect cryptography assumption: only holders of correct keys can decrypt messages
Key Concepts
Freshness: Ensures that keys and nonces are newly generated for each protocol run
Authentication: Verifying the identity of communication partners
Secrecy: Ensuring that sensitive information (like session keys) is only known to authorized parties
Integrity: Guaranteeing that messages haven’t been tampered with during transmission
Summary
This chapter introduces the fundamental concepts of security protocols:
- Motivation: Even with strong cryptographic primitives, building secure distributed systems is challenging
- Protocol Design: Systematic approach to designing key establishment protocols
- Security Analysis: Understanding common attack patterns and vulnerabilities
- Formal Methods: Mathematical notation for precise protocol specification
Key Takeaways
- Security protocols are distributed algorithms with emphasis on secure communication
- Multiple iterations and security analysis are needed to develop robust protocols
- Attackers have significant capabilities (eavesdropping, message manipulation, network control)
- Formal analysis tools are essential for proving protocol security
Next Steps
The following topics build on this foundation:
- Formal verification methods
- BAN logic for protocol analysis
- Modern protocols (TLS, SSH, etc.)
- Implementation security considerations
© 2025 Logical Hacking. ECM2426 Student Notes