Security Protocols: Helping Alice and Bob To Share Secrets (COMP - SEC.220) Coursework I
Security Protocols: Helping Alice and Bob To Share Secrets (COMP - SEC.220) Coursework I
Coursework I
Antonis Michalas
[email protected]
August 31, 2021
Important!
1. In case you do not get at least 40% in this coursework, you immediately fail
the course. There will be no other chance to re-submit another coursework.
This is a theoretical coursework that counts towards 50% of your overall course
marka . You are given a set of exercises to which you should provide a well-explained
and structured solution. All exercises are mandatory.
What you are expected to Submit
1. A PDF file with your solutions;
E XERCISES
E XERCISE 1 – XOR E NCRYPTION (3 MARKS )
You are given a message m and its OTP encryption c. Can you compute the OTP key from m and c?
a) Assume now that Alice uses the secret value a = 6 and Bod uses the secret value b = 9. Compute the interme-
diate values and the final key that Alice and Bob exchange.
b) Assume that Alice and Bob exchange the values X = g a = 5 mod 11 and Y = g b = 10 mod 11. Determine the
secret key they both exchanged!
(Note: The values of a and b are NOT the same as in Exercise 1a.)
c) Decrypt the following message that was encrypted using a shift cipher. The key exchanged in Exercise 3b was
used to encrypt the message.
TVFEFKBDLFUXJUIDBOEZTUSJQFMJOJOH
b) Design a protocol based on the traditional Diffie-Hellman key exchange, that allows 3 parties P 1 , P 2 and P 3 to
exchange a single symmetric key K . The following conditions have to be fulfilled:
• Only the parties P 1 , P 2 and P 3 can know the key K .
• The key should be verified by all parties.
m
You can give your solution as a sequence of message sent from P i to P j . e.g. P i −→ P j . We assume a prime p
and the generator g of the cyclic group Z∗p to be publicly known.
Alice Bob
Alice, r a
Bob, r b , Enc(K , r a )
Enc(K , r b )
h(password) = b3746dd06becc0d83eb520f64111cbb542e03e09
Having this information can you successfully bypass the login authentication and help me log in back to my
account? Can you also remind me my password? If so, please explain how this is possible.
The link to the login form is here: http://amichalas.com/TUNI/TIE-30406/Login_2/. For the
username...you can use anything!
where x is the message, H is a hash function, Enc is a symmetric-key encryption function, || denotes simple
concatenation, and k1 , k2 are secret keys which are only known to the sender and the receiver.
Protocol B:
where k is a shared key, pr is the private key of the receiver, and σpr denotes a digital signature using the
key pr.
Provide a step-by-step description (e.g. an itemized list) of what the receiver does upon reception of c for
each protocol.
2. State whether the following security properties are fulfilled for each protocol given in the previous ques-
tion:
• confidentiality
• integrity
• non-repudiation
(To get full marks, you need to justify your answer. A Yes/No answer will not be considered for marking)
a) A host, A, communicates with a host B across the Internet. Both hosts have each just its own public and
private key pair. Host A needs to “ping” host B in order to make sure it is “alive”. Assume that the two hosts
just synchronized themselves with a Time Server and thus t clA ock = t cl
B
ock
. Provide the best possible solution
under the conditions. Please explain if the problem is solved.
b) If yes, demonstrate how the assumed adversary is countered by your protocol. If no, please explain what
additional steps are required and provide two ways to address the problem.
c) For either case you demonstrated a sufficient solution in (b), consider that A will repeatedly and frequently
“ping” B . Rather than using public key cryptography, consider that A and B wish to use a symmetric key
scheme. First, please explain what can be the motivation, why can a symmetric key protocol be a better
choice. Second, please design a protocol that allows A to “transport” a symmetric key to B .
d) Explain how your protocol in the previous setting allows (or augment here your protocol as necessary) A and
B to mutually authenticate each other and be sure that only the other end (that is, for A only B and vice versa)
got and now knows the new key.
1. Setup: Alice picks a password P and a number N and then computes the following sequence:
, where f () is some easy to compute function but hard to invert. She then stores the pair (x N , N ) with the
server to whom she wishes to login later. Similarly, the server maintains for each user the (different) value
x N and the index N .
2. Authentication: When Alice wants to have access to the host, she types her username and the host looks
up her entry and sends N − 1 to her. She then responds back with the value x N −1 , which the host verifies
by computing f (x N −1 , N ) and comparing against the stored value x N . If the two values match, the server
gives Alice access to her account and replaces the values (x N , N ) with the values (x N −1 , N − 1).
a) What are the advantages (if any) of this scheme over ordinary passwords?
b) What are some attacks (if any) that can be applied to this scheme?
a) A wireless sensor node, A, is required to provide periodically measurements to a device within range, B . The
two share a symmetric key. Each message sent by A contains a single measurement. B needs to verify the
origin authenticity of each message.
b) In the same setting as above, consider a period over which multiple measurements are sent by A. Now,
B needs to verify the authenticity and integrity of this sequence of measurements. At first, assume that
t clA ock = t cl
B
ock
throughout this period.
c) In the previous setting, assume that the clock of A cannot be synchronized with that of B . Again, B needs to
verify the authenticity and integrity of this sequence of measurements.
e) In the previous setting, now B needs A to use different symmetric keys for ensuring confidentiality and au-
thenticity. Let those be KcAB and KaAB respectively and assume that those are available at A and B .
f) Without re-writing the protocol you devised for the previous setting: How can you handle a situation that A
and B have only one shared key for authentication but they decide to use a second one for confidentiality?
E XERCISE 11 – K EY D ISTRIBUTION (15 MARKS )
Consider the following key distribution protocol in which two users Alice and Bob wish to establish a shared key
KAB with the help of a trusted server S. Assume Alice and Bob share secret keys KAS and KBS with S and that
nonces are 64 bits long and keys are 128 bits long.
1. A → B : Al i ce, N A
a) Describe at least two attacks that can be applied to this protocol (If your attack reduces to simple forwarding,
it will not count...).
b) For each attack, give a countermeasure that renders the attack useless.