Chapter 8i: Secure Channel Flashcards
What does a secure channel provide?
Where are such constructions used?
Note:
- Confidentiality, Integrity, Authenticity
- Messages received in correct order
- No duplicates/replayed messages (Bonus: we know which messages are missing)
- Virtual private network protocols (VPN) like OpenVPN, IPSec, Wireguard
- Transport layer security protocols like TLS, DTLS
- Secure messenger applications like Signal
- Secure channels require a long term (symmetric or asymmetric) key to work
- Exchanging/agreeing on long term keys is often done out of band
- How can we achieve confidentiality, integrity, and authenticity?
- Using a symmetric cipher and a MAC algorithm
- Security differs between the options
- We are using different keys for encryption and integrity protection: k-int and k-enc
- k-int and k-enc can be derived from a session key k using a key derivation function (KDF)
#1: MAC-then-Enc
- Enck -enc (m, MACk -int (m)):
#2: MAC & Enc
#3: Enc-then-MAC
Secure Channel Implementation
What do we need? Illustrate a toy implementation.
- Message numbering
- Encryption
- Authentication
Secure Channel Implementation
Message Numbering:
Secure Channel Implementation
Explain.
- We generate one key for each purpose
- Initialization was shown for Alice! On Bob’s side, keys will be generated differently:
e.g.: K_send_enc = KDF(k || “Enc Bob to Alice”) - We assume Alice and Bob share a session key k , established using authenticated DH key exchange
- Where · ∥ · means string/byte concatenation
Explain.
- Nonces are random 120bit values
- We avoid the (unlikely) event that the same nonce is generated twice
Secure Channel Implementation
What’s going on here?
Sending a message.
Secure Channel Implementation: Problems?
- Verifying a MAC: def verify(k, msg, t):
return HMAC -SHA -256(k, msg) == t
Problem:
* Runtime of equality test of two strings differs!
* Longs runtime for equal strings!
* Shorter runtime for different strings (function returns after first different byte!)
* Different runtimes can be attack vector for timing/side channel attacks!
* (See padding oracle attack)
Secure Channel Implementation
Secure Channel Implementation
- Receiving a Message:
if n_recv + 1 >= MAX_INT - 1:
if not verify(K_recv_int, n || IV || c, t):
if n <= n_recv:
if n != n_recv + 1:
DEC-AES-128-CTR(K_recv_enc, IV, c)