
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

















This is based on Chapters 14 and 15 of “Practical Cryptography” by Niels Ferguson and Bruce Schneier
A secure channel a secure connnection between two parties A basic tool in crypto protocols.
Roles Alice, Bob, Eve
Key Alice and Bob share a secret key K. Requirements I K is known only to Alice and Bob. I Every time the secure channel is initialized a new value is generated for K.
Messages A sequence of discrete messages. Assumption: I The transport layer is not reliable. E.g., TCP/IP is reliable against random events, but not an active and clever attacker. More...
Message Numbering
I Why? I Number 1 through 232 − 1. After 232 − 1 messages, refresh the key.
Authentication
I Use a standard MAC: HMAC-SHA-256. I For message i: ai : = M AC(i‖(xi)‖xi‖mi) xi = context data for Bob.(xi) = the length in bytes of xi
Encryption
I Use AES in CTR mode. I Messages no larger than 16 · 232 bytes.
Frame Format i coded as a 32-bit integer, least significant byte first followed by the encrypted mi and ai.
Protocol and Message IDs
I A message needs to contain:
Message Encoding and Parsing
I The encoding has to be flexible enough to handle variable length messages. I Fixed length fields are simple, but they seldom survive version changes.
Protocol Execution States
I Event-driven. A state-machine is a good idea.
A replay attack Eve records a message and later sends that message again.
A retry Alice didn’t get an acknowledgement from Bob about the last mes- sages, so she sends it again.
How is Bob to securely handle repeated messages? Upon receiving a message:
I If it is the one expected, do the normal things. I If it is a message “from the future” (e.g., expecting #8, receiving #23), ignore it. I If it is a message “from the past”:
Goal Alice and Bob want to agree on a secret session key for a secure channel.
Assumption We assume A&B can authenticate messages to one another. A&B may have a shared secret key for authentication.
Question: If they already share a secret key, why bother with another?
Answer:
I Compartmentalization, just like in spy networks. I If the session key is compromised, the long-term key is safe. I If the long-term key is compromised and Eve hasn’t recorded yester- day’s key negociation, then yesterday’s exchanges are safe.
Protocols last forever
I So they need to be designed to be future proof. I E.g., that is why having (p, q, g) is a bad idea. I A protocol switch/rollback is a point of attack.
Authentication conventions
I At any point in the protocol, the authentication data consists of all data exchanged so far. E.g., In try 1, Alice’s authentication data we consist of: X and Y and Bob’s would be X, Y , and AuthA(... ). I This is reasonably cheap and stops lots of attacks. I Henceforth: AuthA = Alice’s authentication message at this point of the protocol. AuthB = Bob’s authentication message at this point of the protocol.
Alice Chooses s : = min size of p and NA
ran ∈ { 0 ,... , 2256 − 1 }. Sends s, NA to Bob. NA is a nonce.
Bob Chooses (p, q, g) and x
ran ∈ Z∗ q. Computes X = gx. Sends (p, q, g), X, AuthB to Alice.
Alice Checks (p, q, g), X, AuthB. Chooses y
ran ∈ Z∗ q. Computes Y = gy. Sends Y, AuthA to Bob. Computes k = Xy.
Bob Checks Y, AuthA and computes k = Y x.
I k is of variable size. I k has algebraic structure.
Alice Chooses s : = min size of p and NA
ran ∈ { 0 ,... , 2256 − 1 }. Sends s, NA to Bob. NA is a nonce.
Bob Chooses (p, q, g) and x
ran ∈ Z∗ q. Computes X = gx. Sends (p, q, g), X, AuthB to Alice.
Alice Checks (p, q, g), X, AuthB. Chooses y
ran ∈ Z∗ q. Computes Y = gy. Sends Y, AuthA to Bob. Computes k = SHAd-256(Xy).
Bob Checks Y, AuthA. Computes k = SHAd-256(Y x). See page 270 of F&S for the long form.