Lecture 7 - Key Management - Notes
Lecture 7 - Key Management - Notes
Lecture 7
1
Reminder of previous lecture
❑ Authentication
o What is needed for entity authentication?
o Data origin authentication (sure who generated)
▪ MAC/Encryption/Signature
▪ Stops masquerade attacks
o Freshness (is the message generated now?)
▪ Nonce (Random or counter/sequence)/Timestamp
▪ Stops replay
o We looked at protocol examples…
▪ Also remember the reflection attack
2
Today’s Lecture
❑ Key Management
o For all crypto we need keys (most important)
o Symmetric key management
o Asymmetric key management (Certificates)
❑ CILO1,CILO2, CILO3 CILO4
(identify requirements, core threat, design and
evaluation)
Credit to Keith Martin RHUL (borrowing few slides from his lecture notes – 6, 45-47)
3
Key Management
What is Key Management?
We use them, we might want to revoke and change the keys. Finally
we might need to destroy to keys once we no longer have use for
them. We might also need to archive some keys for a while.
5
with it in the first place.
5
Hardware Security Module (HSM)
6
Symmetric-key protocols
❑ The use of symmetric-key
cryptography to produce a shared
symmetric secret key.
❑ The protocols can be classified as:
o Directly communicating entities
o Use of a Key Distribution Centre (KDC)
o Use of a Key Translation Centre (KTC)
For slide 7-12 you are only expected to know the two main models
(KDC/KTC) and why these are preferable to the directly
communicating model (more efficient key storage)
At this early stage you should already be familiar with the later
discussed concept of key control (none of the parties have key
control
7
Directly communicating
entities
❑ The case where two entities directly
communicate to establish keys.
❑ Must take place using a secure
channel (e.g. using an existing shared
secret key or mutually trusted copies
of each others’ public keys).
How many long term keys must each user store in this system?
How many keys must each user store in this system? I just need to
share a key with the KDC/KTC.
Distribution within a domain
❑ Key Translation Centre (KTC): An entity
trusted to transport keys between
entities that share keys with the KTC.
o Example of a key transport service.
❑ Key Distribution Centre (KDC): An entity
trusted to generate and distribute keys
to entities that share keys with the KDC.
o Arguably example of a key agreement
service.
The key distribution centre is similar, but also creates the key. In a
KDC service, the KDC has complete key control. This means that
neither of the user’s has key control and so, if we trust the KDC,
no-one can apply any undue pressure in choosing the key.
10
Key Translation Centre
Key
Translation
Centre
1 2
3
Entity A 3 Entity B
How much long term keys does Alice need to store - one.
How much long term keys does Bob need to store - one.
The KTC only communicates with one entity – one session with Alice. Does
not need to talk to B.
What if we did not have Alice and Bob, what if we had Alice’s smart card
reader and Bob smart card – the KTM cannot initiate a session with Bob’s
smart card….
11
Key Distribution Centre
Key
Distribution
Centre
1 2
2
Entity A 3 Entity B
Once again lets start with a number of definitions, listed within the
standard. ISO/IEC 11770 contains a lot of definitions:
Suppose – I want you to get into the AC1 office (I go to the hardware
store, randomly pick up a key/lock combo box). Hand the keys to you and
then install the lock. What type of key establishment is this? Do I really
have key control – in that I can choose the specific key I want you to use?
No, I chose a random box. This is key agreement.
Lets say I put a password on the Canvas page, and then handed everyone a
note in class with their password. What type of key establishment do we
have? Who has key control? I have key control as I decide on the
password – so key transport.
13
Who has the key at the end?
❑ We can set two requirements of key establishment
o Implicit key authentication to A: The assurance for A
that only another identified entity can possess a key.
This is the basic security requirement.
o Explicit key authentication to A: The assurance for A
that only another identified entity possesses a key. This
is a more stringent security requirement.
14
Key establishment mech. 6
❑ Directlycommunicating entities.
❑ A, B must share a secret key KAB.
❑ RA and RB are nonces.
❑ FA and FB contain keying material.
M1 = RB
M2 = EncKAB(RA||RB||B||FA||Text1)
A B
M3 = EncKAB(RB||RA||FB||Text4)
Who has key control? Neither have control (both contribute), key
agreement protocol.
M3 = EncKAT(R′A||F||B||Text1)||EncKBT(RB||F||A||Text2)
M1 = RB
M4 = EncKBT(RB||F||A||Text2)||EncKAB(RA||RB||Text3)
A B
M5 = EncKAB(RB||RA||Text4)
TTP is authenticated to A
TTP is authenticated to B
A and B mutually authentication
Why are the nonces swopped around in M5?
Else you just send back what was sent to B in M4.
17
Remember from last lecture….
Is A authenticated to S? No
Is S authenticated to B? No
18
Is B authenticated to A? Not really, Message 4 (Nb encrypted with KAB),
only B could retrieve and use KAB from message 3 but we do not know
what Nb is supposed to be. It would have been better for message 3 to be
Na,{Kab,A}Kbs and 4 to be {Na,Nb}Kab. Then A and B would be mutually
authenticated.
18
Public-key protocols
❑ The use of public-key cryptography to
produce a shared symmetric secret key.
❑ The protocols can be classified as:
– Key transport protocols (typically involving
public-key encryption and digital signatures)
– Key agreement protocols (indirectly specified
and mostly based on the Diffie-Hellman
protocol)
19
Notation
❑ A and B are (identifiers for) two entities
who wish to engage in an authentication
protocol.
❑ RA is a random nonce generated by A.
❑ EncA(X) denotes the encryption computed
with A’s public key on the data X.
❑ SigA(X) denotes the signature (with
appendix) computed by A on the data X.
M1 = RB
A M2 = B||RA|| RB||EncB(A||K)|| B
SigA(B||RA||
RB||EncB(A||K))
A is authenticated to B
23
Why use a key hierarchy
❑ The more we use a key the more likely it is to
be compromised….
❑ Key establishment from nothing is hard…
❑ Use top layer keys sparingly (long lifetime)
o These keys used for only for key establishment
❑ Low level keys used often (short lifetime)
o Compromise of a session key of limited significance.
24
Key hierarchy has influence on the key lifetime – session keys are
used very often, and also therefore changed very often. As you go
up the layers the key lifetime increases. The master key is very
rarely used – and attacker has very limited access to cases where
this key is used.
So if you wish – session keys are easy to attack, but does not help
the attacker much because it changes often. Master key stays the
same a long time but master key is very difficult to attack.
24
key, there is a department key, there is a lecturer key, and then a daily
session key for working with material that day. So regularly during the
day use the session key, I upload weekly reports using lecturer key (get
issues a new one for next week), department uploads to university once a
month (renew key).
24
Example: Simple payment card
❑ Closed system
o Cards/readers all controlled by same entity
❑ What keys do we need?
o Card and reader need to share a key
❑ Problem?
o Reader cannot store each possible card key!
o So give all cards the same key?
o One compromised card = completely broken system!
❑ The reader contains system master key
o Card contains card key
o Reader use master key and UID to derive card key
o Reader and card communicate….
❑ If card compromised then only limited damage.
25
For interest
25
Public Key (Certificate)
Management
Remember….we would like to use
signatures (and PKE)
M1 = TA||SigA(TA||B)
A B
M2 = EncA(Data)
How do we verify a public key?
M1 = ‘I am A’,TA||SigM(TA||B)
M B
M3 = ‘Hi A’, EncPM(Data)
You should be able to explain why we need to properly verify a public key and how a public
key certificate helps us in this matter.
In reality the protocol should look more like this – unless B gets the public key from
someone else.
What if M tells B she is A and then give him a public key she claims is also As? Then we
have a problem, therefore we need to be able to verify that this key does indeed belong
to A.
Digital Certificates
❑ Public key encryption: encrypt using receiver’s public key
o sender has to be sure that the public key used for encryption is indeed the receiver’s public
key
❑ Digital signature: verify a signature
o Verifier has to be sure that the public key used for signature verification is indeed the
signer’s public key
❑ How can the encryptor / verifier be sure that the public key is authentic?
cryptanalysis M
private key
Eve
M C M
encryption decryption Alice
Alice’s public key private key
Alice’s Personal Homepage
This is not easy problem to solve, we cannot simply send public keys
by email or put them on websites as they can be changed.
29
Digital Certificates
❑ How it works:
o There is an entity called Certification Authority (CA) in the system
o CA has a public key which is ASSUMED to be well known
▪ e.g. built-in, preinstalled into all the web browsers/operating systems
o CA issues a certificate to each public key owner
o The certificate bears (1) the public key owner’s identity, (2) the public key,
(3) a validity period of the certificate and (4) the CA’s signature
o By using the certificate, the CA vouches that the public key in the certificate
is owned by the public key owner.
o The CA publishes a Certification Practice Statement (CPS) that specifies the
policies (including liabilities) governing the use of the certificates issued.
❑ Only the CA can create a legitimate certificate
o Only the CA can generate the signature in the certificate which requires the
knowledge of CA’s private key
❑ Anyone can verify the authenticity of the certificate using CA’s public key
CertA = (IDA, PKA, expiry-date, SignCA(IDA, PKA, expiry-date))
30
The Certification
Authority
❑ The “CA” is responsible for:
o identifying entities before certificate
generation
o Generating user key or verifying user key
o ensuring the quality of its own key pair,
o keeping its private key secret.
❑ The CA, before generating a certificate,
ought to check that a user knows the
private key corresponding to its claimed
public key.
I go and take you public key, go to the CA and get a certificate that says
this is my public key. Now I can prove that this is my document?
31
Who is involved?
Key
Generation
Registration
Authority
Certification
User
Authority
Directory
You must be able to explain this diagram – who are the entities
involves in PKI and what is each of roles in the process of issuing a
certificate?
Meanwhile the user proves its identity to the RA, which then forwards
this guarantee to the CA.
32
Some Remarks on Digital Certificates
❑ Certificate authority (CA) is considered as a Trusted Third
Party (TTP) that issues and signs certificates
o Verifying CA’s signature in a certificate only verifies the binding
validity between the public key and the identity in the certificate
vouched by the CA
o Verifying CA’s signature does not verify the identity of the source
that the certificate comes from!
▪ E.g. Alice may receive Carol’s certificate from Bob
o Certificates are public!
o Common format for certificates is ITU-T X.509.
33
X.509 certificates
❑ X.509 is a standard format for public key
certificates (and CRLs).
❑ Standard first published in 1988.
❑ Latest was published in 2021.
❑ X.509 is part of the ITU-T Directory series of
recommendations (ISO/IEC 9594).
❑ Certificate format specified in ASN.1.
❑ Note that the latest edition of X.509 covers
‘attribute certificates’ as well as public key
certificates.
34
What’s Inside a Certificate (X.509)
e.g.
User Name User Name (Common Name): www.hsbc.com.hk
Certificate Version Validity Period: Apr 16, 2010 – Apr 17, 2011
User’s Public Key: RSA (2048 bits)
Modulus (2048 bits): 30 82 01 0a 02 82 01…
Validity Period
Exponent (24 bits): 01 00 01
Serial No CA’s name (Issuer): VeriSign Class 3 Extended Validation SSL SGC CA
CA’s signature (Certificate Signature Value): Size: 256 Bytes / 2048 Bits
User's Public Key There are many other attributes: Certificate serial no.,
certificate version number, HSBC public key algorithm, CA’s
Other user attributes
signing algorithm, etc.
CA's name
35
Certificate Revocation
❑A CA is responsible for the lifetime
management of certificates, including
renewal, update and revocation.
❑ Two methods for managing revocation:
o use of Certification Revocation Lists, i.e.
lists of revoked certificates, signed by CA
o providing an on-line validation service.
Slidess 36-37 is mostly for interest. Know only what a CRL is, and
understand why we need to revoke certificates. Why? As the keys
might become compromised, user got new keypair, etc.
There may be many reasons for this, e.g. compromise of the private
key, name change, organisation change, etc. There are two
commonly discussed methods for managing revocation:
• the use of Certification Revocation Lists (CRLs), i.e. lists of
revoked certificates, signed by the CA,
• the provision of an on-line certificate status checking service
(such as OCSP). So each time you want to use a certificate you ask
the CA if it is still valid.
CRLs
❑ Each CRL entry contains the serial
number of the X.509 certificate
being revoked.
❑ CRLs must be updated at regular
defined intervals, enabling CRL user
to verify that they are in possession
of the ‘latest’ version.
Each CRL entry contains the serial number of the X.509 certificate
being revoked.
The problem is that the person checking the certificate validity has no
idea whether is has the latest update…an attacker might be preventing
these pushed updated from coming through. If we had regular updates,
the user would realise that is does not have the latest CRL.
By publishing at know periodic intervals the user can be sure that he has
the latest copy.
37
Online certificate status
protocol
❑ Online Certificate Status Protocol (OCSP) enables
certificate status to be queried.
❑ OCSP may provide more timely revocation
information than is possible with CRLs.
❑ Entity issues status request to TTP and suspends
acceptance of certificate until TTP gives
response.
❑ The protocol specifies data exchanged between
entity checking certificate status and the TTP
providing that status.
39
PKI Trust Models
Monopoly model
❑ One universally trusted organization is the CA for the
known universe
❑ Big problems if CA is ever compromised
❑ Big problem if you don’t trust the CA!
o Should country X trust CA in country Y?
o Where and who would this CA be?
Anarchy model for interest only, you must know how the structured
model works.
40
PKI Trust Models
❑ Anarchy model
o Everyone is a CA!
o Users must decide which “CAs” to trust
o Used in PGP (Pretty Good Privacy)
▪ www.pgpi.org
o Why do they call it “anarchy”?
▪ Suppose cert. is signed by Frank and I don’t know Frank,
but I do trust Bob and Bob vouches for Frank. Should I
trust Frank?
▪ Suppose cert. is signed by Frank and I don’t know Frank,
but I do trust Bob and Bob says Alice is trustworthy and
Alice vouches for Frank. Should I trust Frank?
41
Digital Signture and PKI
o Scalability weakness
▪ Trust is not transferrable. Alice trusts Bob, Bob trusts Carol, does not necessarily
mean that Alice trusts Carol.
▪ It may be cumbersome for one to get adequate certificates so that one’s public key
can be trusted.
You also need to know who signs a Cas certificate and how the
highest level CA’s certificates are signed (cross or self
certification)
43
Cross certification
45
In some cases really important CAs can also self sign – how does
this work? Well we use the public key on the cert to verify the cert
signature (this means the cert if not modified an made by the CA)
and we trust that the CA is honest..
45
Certificate Chains
She verifies CA2’s cert with key on CA1 cert (CA1 and CA2 cross
certified)
She trusts CA1, therefore she trusts all the way down to Bob
46
How to Use PKI – Secure Web Browsing
Web Server
❑ The web browser has the CA’s public key built in.
o The legitimacy of the web browser software becomes crucial for ensuring
the security of digital certificates
o A certificate is NO more secure than the security of the web browser
❑ In practice, each browser trusts multiple CAs rather than just one
❑ Exercise: find out the number of CAs that your browser trusts
47
Payment Card Example
❑ EMV credit cards
o Open payment (different card vendors and payment terminals
different systems)
o Authentication of card/transaction data
o Card vendors not giving terminal vendor their master
symmetric key!!! So what now?
❑ How can we authenticate if we do not trust others
with our secret keys?
❑ Use public key crypto – use certificates!
o Step 1: Card signs transaction data and also sends the card’s
certificate
▪ Card certificate signed by card vendor
o Step 2: Terminal has card company certificate, so verifies
card certificate, then verifies card signature
48
48
Digital Signture and PKI
50
Digital Signture and PKI
For example, EU has similar legal issue to ETO. But very few
recognized trusted CAs (some counties only has one).
52
Coldboot
https://en.wikipedia.org/wiki/Cold_boot_attack
52
E-passport
❑ Sometimes need to design for
interesting case
❑ E-Passports (governed by ICAO)
❑ Passive Authentication
o Data signed
o Who needs to verify?
❑ Basic access control
o Verify symmetric key
o Who needs this key?
53
You travel everywhere – are these guys online? Do they like your
government?
Maybe not – so you cannot share symmetric keys. This would also
mean the person you are sharing with can recreate the passport (as
they have the key).
53
E-passport c’ntd
❑ Example of key management things going
wrong!
❑ Basic access control key size
o Theory: Serial no, birthday, expiry date = 50
bits
o Reality: Predictable values, so closer to 25 bits
o Had to fix: Alphanumeric random serial no
❑ Passive authentication verification
o A few years after adoption not a lot of people
were actually verifying the signature using
country certificate
54
54
Advanced Threats
❑ Stuxnet was a multi-stage malware targeting
intermediate systems (MS Windows,Siemens
PCS7, WinCC) to reach its main objective
(Siemens S7 PLCs).
❑ Stuxnet's delivery mechanism was based on the
Microsoft Windows platform, but its primary
objective was industrial control systems
❑ The control systems targeted were highly
specific
❑ A number of zero-day exploits were deployed
55
Zero days
The attack vectors exploit print spoolers remotely, local files (typically via USB
pen drives), and network
Shares
Operating system variants from Windows 2000 onwards (including XP, Vista, 7
and server variants 2008 and
2008R2) were catered for explicitly.
55
STUXNET (1)
56
56
Stuxnet (2)
❑ Stuxnet uses different mechanisms, including
hiding itself on removable storage media (to get
to air-gapped systems)
❑ A device driver is installed looking for files
matching the characteristics of the Stuxnet
payload.
o What do you need to install driver on Windows?
o Private key of trusted vendor
▪ Jan-June 2010(Realtek), Verisign revokes certificate
▪ July…(JMicron Tech)
❑ Core part of this issue: two compromised keys
57
57
The end!
?
Any questions…
58
58