Curs 12 TLS
Curs 12 TLS
Applications
Security of TLS
Secure Socket Layer (SSL)
Secure Sockets Layer (SSL)
• Privacy of data;
• Authentication of the parties;
• Integrity.
A bit of history:
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 2 / 27
SSL 3.0
Version 3.0 of SSL was produced by Paul Kocher, working with Netscape
engineers, when Taher ElGamal was Chief Scientist at Netscape
Communications:
“Taher had a clear vision for SSL 3.0, but had many other things
on his platter as well, so he made arrangements for me and Phil
Karlton to do the main work of designing the protocol.”
Paul Kocher
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 3 / 27
The 2019 Marconi prize
Figure 1: Paul Kocher (left) and Taher ElGamal (right) awarded the 2019
Marconi prize for their contributions to the security of communications.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 4 / 27
SSL in a nutshell
Even though SSL 3.0 has been implemented and used since 1996, the
first complete document published appeared only in Aug 2011 (Freier
et al. (2011)). Some points of reference on it:
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 5 / 27
SSL in the TCP/IP protocol stack
TCP Transport
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 6 / 27
Usage scenario
HTTP HTTP
SSL SSL
TCP TCP
IPsec
IP IP
ETHERNET ETHERNET
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 7 / 27
Transport Layer Security (TLS)
Transport Layer Security (TLS)
• 1996: The IETF Transport Layer Security (TLS) working group was
created to unify and standardize the SSL 3.0 protocol and similar
variants such as PCT/STLP. The final result would be called TLS;
• TLS Standards:
• TLS 1.0 – 1999 (RFC 2246);
• TLS 1.1 – 2006 (RFC 4346);
• TLS 1.2 – 2008 (RFC 5246);
• TLS 1.3 – 2018 (RFC 8446);
• TLS has a similar structure to SSL but added significant changes
from standard to standard:
• Removed broken features (e.g., compression);
• Improved the crypto architecture of the protocol: HMAC, AEAD,
HKDF, etc.;
• Improved latency (e.g., handshake in 1-RTT or even 0-RTT);
• Improved security and privacy (e.g., forward secrecy).
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 8 / 27
TLS 1.3
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 9 / 27
TLS in the TCP/IP protocol stack
TLS Handshake
TLS
TLS Record
Transport
TCP
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 10 / 27
Sessions and connections
• Session
• Association between two communicating peers;
• Defines a set of cryptographic parameters which can be shared
among multiple connections;
• Created by the handshake protocol;
• Primarily used to avoid expensive negotiation of new security
parameters for each connection;
• Connection
• Transport (in the OSI layering model definition) that provides a
suitable type of service;
• Each connection is associated with one session.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 11 / 27
TLS handshake protocol
Once the handshake is complete, the peers use keying material to derive
the application data traffic keys.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 12 / 27
TLS handshake protocol
TLS supports two basic key exchange modes, one of which has two
variants:
When clients and servers share a PSK (either obtained externally or via a
previous handshake), TLS 1.3 allows clients to send data on the first
flight (early data). The client uses the PSK to authenticate the server
and to encrypt the early data.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 13 / 27
Basic full handshake
C = Client S = Server
Step 1
C Hello + C KeyShare
Key Exchange
unprotected
communication
S Hello + S KeyShare
Step 2
AEAD-protected
with tKHS keys
{S Cert}, {S CertVrfy}, {S Fin}
Authentication
[·]
[App data]∗
AEAD-protected
with tKapp keys
Step 3
[App data]
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 14 / 27
Establishing a PSK in a previous connection
C = Client S = Server
Initial HS
Step 3
Compute RM S
PSK
[NewSessionTicket]
[App data]
Step 1
C Hello+C KeyShare∗ +C PSK Mode+C PSK
{EncExts}
Step 2
{S Fin}
[App data]∗
Step 3
{C Fin}
[App data]
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 16 / 27
PSK-based handshake with early data: 0-RTT
C = Client S = Server
AEAD-protected with
tKeapp derived from PSK
S Hello + S KeyShare∗ + S PSK
{EncExts} + S ED∗
Step 2
{S Fin}
[App data]∗
(End of ED)
Step 3
{C Fin}
[App data]
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 17 / 27
HMAC-based key derivation
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 18 / 27
Key derivation flow
PSK HKDF.Ext
BK ES = Early Secret
BK = Binder Key
ES ETS tKeapp ETS = Early Traffic Secret
tKeapp = Early App Traffc Key
EEMS EEMS = Early Exporter Master Secret
dES dES = Derived Early Secret
(EC)DHE HKDF.Ext
HS = Handshake Secret
CHTS tKchs CHTS = Client Handshake Traffic Secret
HS tKchs = Client Handshake Traffic Key
SHTS tKshs SHTS = Server Handshake Traffic Secret
tKshs = Server Handshake Traffic Key
dHS dHS = Derived Handshake Secret
0 HKDF.Ext tKcapp
CATS MS = Master Secret
CATS = Client App Traffic Secret
SATS tKsapp tKcapp = Client App Traffic Key
MS SATS = Server App Traffic Secret
EMS tKsapp = Server App Traffic Key
EMS = Exporter Master Secret
RMS RMS = Resumption Master Secret
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 19 / 27
Handshake properties (1)
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 20 / 27
Handshake properties (2)
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 21 / 27
The record protocol
Application data
Fragment
Len ∥ SqN ∥ · · ·
MAC
AEAD
Len ∥ SqN ∥ · · · MAC Pad
Encrypt
Hdr
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 22 / 27
Alert messages
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 23 / 27
Applications
Applications
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 24 / 27
Security of TLS
Security of TLS
1. The study of TLS 1.3 protocol security is a hot research topic with
paramount practical importance;
2. Many research articles and doctoral theses have been written in this
direction;
4. The two primary directions are the study of TLS 1.3 security in the:
4.1 Symbolic model: Horvat (2015); Cremers et al. (2017); Hoyland
(2018); van der Merwe (2018); Scott (2018);
4.2 Computational model: Jager et al. (2012); Giesen et al. (2013);
Kohlar et al. (2013); Dowling et al. (2021); Aviram et al. (2021);
Bhargavan et al. (2022); Davis et al. (2022).
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 25 / 27
References
Aviram, N., Gellert, K., and Jager, T. (2021). Session resumption protocols and efficient forward
security for TLS 1.3 0-RTT. Journal of Cryptology, 34.
Bhargavan, K., Cheval, V., and Wood, C. (2022). Handshake privacy for TLS 1.3. Research
report, Inria Paris; Cloudflare.
Cremers, C., Horvat, M., Hoyland, J., Scott, S., and van der Merwe, T. (2017). A comprehensive
symbolic analysis of TLS 1.3. In Proceedings of the 2017 ACM SIGSAC Conference on
Computer and Communications Security, pages 1773–1788.
Davis, H., Diemert, D., Günther, F., and Jager, T. (2022). On the concrete security of TLS 1.3
PSK mode. In Dunkelman, O. and Dziembowski, S., editors, Advances in Cryptology –
EUROCRYPT 2022, pages 876–906, Cham. Springer International Publishing.
Dowling, B., Fischlin, M., Günther, F., and Stebila, D. (2021). A cryptographic analysis of the
TLS 1.3 handshake protocol. Journal of Cryptology, 34.
Freier, A. O., Karlton, P., and Kocher, P. C. (2011). The Secure Sockets Layer (SSL) Protocol
Version 3.0. RFC 6101.
Giesen, F., Kohlar, F., and Stebila, D. (2013). On the security of tls renegotiation. In Proceedings
of the 2013 ACM SIGSAC Conference on Computer and Communications Security, CCS’13,
page 387–398, New York, NY, USA. Association for Computing Machinery.
Horvat, M. (2015). Formal analysis of modern security protocols in current standards, ph.d. thesis.
Hoyland, J. (2018). An analysis of TLS 1.3 and its use in composite protocols, ph.d. thesis.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 26 / 27
Jager, T., Kohlar, F., Schäge, S., and Schwenk, J. (2012). On the security of TLS-DHE in the
standard model. In Safavi-Naini, R. and Canetti, R., editors, Advances in Cryptology –
CRYPTO 2012, pages 273–293, Berlin, Heidelberg. Springer Berlin Heidelberg.
Kohlar, F., Schäge, S., and Schwenk, J. (2013). On the security of TLS-DH and TLS-RSA in the
standard model. IACR Cryptol. ePrint Arch., 2013:367.
Scott, S. (2018). The design and analysis of real-world cryptographic protocols, ph.d. thesis.
van der Merwe, T. (2018). An analysis of the Transport Layer Security protocol, ph.d. thesis.
Prof.dr. F.L. Ţiplea, UAIC, RO Lectures on Information Security Web SecuritySSL and TLS Fall 2023 27 / 27