4: Cryptography and TLS

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

21 Terms

1
New cards

Need for Encryption

It’s always possible for Internet traffic to go to the wrong places - you can’t control where packets go and everyone would be able to see what you send.

2
New cards

Needham-Schroeder Public Key Protocol

A protocol that sets up a symmetric key between two parties using public keys.

3
New cards

Needham-Schroeder Protocol - Notation

  • A → B: EB(Na, A)

    • Alice encrypts a message with Bob’s public key, saying “I am Alice and here is my nonce”

  • B → A: EA(Na, Nb)

    • Bob encrypts a message with Alice’s public key, saying “Here’s your nonce back to prove I am the person you sent the message to, here’s mine too”

  • A → B: EB(Nb)

    • Alice returns Bob’s nonce encrypted with his public key, proving it is her.

4
New cards

Needham-Schroeder Protocol - Vulnerability

Can be MITM’d, with an adversary - C - pretending to be A.

  • A → C: EC(Na, A)

    • C(A) → B: EB(Na, A)

  • B → C(A): EA(Na, Nb)

    • C → A: EA(Na, Nb)

  • A → C: EC(Nb)

    • C(A) → B: EB(Nb)

A knows it’s talking to C, but B thinks it’s talking to A when it’s actually talking to C.

5
New cards

Forward Secrecy

A protocol that even if an attacker has a recording and long term keys of the principal, cannot be broken.

6
New cards

Station to Station Protocol (STS)

A key exchange protocol that achieves forward secrecy by discarding important values after the protocol has finished.

7
New cards

Station to Station Protocol (STS) - Notation

  • A → B: gx

  • B → A: gy, {SB(gy, gx)}gxy

  • A → B: {SA(gy, gx)}gxy

  • B → A: {M}gxy

x, y and gxy are discarded after the protocol is run, with keys only used for signing to verify both identities.

8
New cards

Diffie-Hellman Key Exchange

A key exchange algorithm that relies on computational intensity, picking a large prime number and a primitive root.

<p>A key exchange algorithm that relies on computational intensity, picking a large prime number and a primitive root.</p>
9
New cards

Diffie-Hellman Key Exchange - Process

  • Two parameters, p and g, are chosen and shared in plaintext

    • p is a prime number

    • g is a primitive root

    • g < p and gcd(g, p - 1) = 1

  • Each party chooses a value between 2 and p - 2.

    • A = ga mod p

    • B = gb mod p

  • A and B are shared with the other party.

  • A shared key is then derived:

    • K = Ba = gba

    • K = Ab = gab

10
New cards

Important/Ideal Properties in a Protcol

  • They must provide secrecy

  • The keys must be fresh

  • Both parties should authenticate who they’re talking to

  • The protocol should be forward secret

  • The protocol should not support weak cipher suites

  • The protocol should not allow KCI (key compromise impersonation) attacks

  • The protocol should not be overly complex or have lots and lots of different modes

11
New cards

Transport Layer Security (TLS)

A form of encryption used on the Internet as part of HTTPS.

12
New cards

Transport Layer Security (TLS) - Notation

  • C → S: Nc, possible ciphersuites

  • S → C: Ns, Certs, chosen ciphersuite

  • C → S: ES(Kseed), {Hash1}Kcs

    • Where Hash1 = #(NC, NS, ES(Kseed))

  • S → C: {Hash2}Kcs

    • Where Hash2 = #(NC, NS, ES(Kseed), {Hash1}Kcs)

KCS is a session key based on the key derivation function (KDF) that uses NC, NS and Kseed.

13
New cards

TLS-DHE

An extension of TLS1.2 that uses Diffie-Hellman to make the protocol forward secret.

14
New cards

TLS-DHE - Notation

  • C → S: Nc, possible ciphersuites

  • S → C: Ns, gx, CertS, SignS(#(NC, NS, gx)), chosen ciphersuite

  • C → S: gy, {#(all previous messages)}K

  • S → C: {#(all previous messages)}K

K = kdf(NC, NS, gxy)

15
New cards

TLS - Authentication

Only server authentication is done, but client authentication can be done as well by having the client send their certificate over and verified accordingly.

16
New cards

TLS1.2 Deprecation

It had a lot of configurable options (e.g. client certification) that made it vulnerable - there were attacks against rare options, certain ciphersuites and implementation errors.

  • It also required 2 round-trips before sending data.

17
New cards

Key Compromise Impersonation Attacks

Any client with a known key can be fooled into thinking it’s talking to someone else.

18
New cards

KCI with Static DHE and Client Certificates

  • C → S: NC, possible ciphersuites

  • S → A(C): NS, CertS, gx, SignS(#(NC, NS, gx))

    • A(S) → C: NS, CertS, gx, SignS(#(NC, NS, gx)), Request Cert

  • C → A(S): gc, CertC(gc), {#(previous message)}kdf(Nc, Ns, gxc)

    • Because of Cert(gc), the attacker now knows c and can find gxc (the key)

  • A(S) → C: {#(previous message)}kdf(Nc, Ns, gxc)

19
New cards

TLS v1.3

An upgrade of TLS from 1.2 that attempts to resolve the issues 1.2 had.

20
New cards

TLS v1.3 - Forward Secrecy

Uses Diffie-Hellman from the very start to include forward secrecy in every communication.

21
New cards

TLS v1.3 - Notation

  • C → S: NC, ciphersuites, gx

  • S → C: NS, ciphersuites, gy,

    • {Certificate: (pks)}kdf1(gxym log1),

    • {CertVerify: (signskS (H(log2))}kdf1(gxy, log1),

    • {Finished: mackdf2(gxy, log1)(H(log3))}kdf1(gxy, log1)

  • C → S: {Finished: mackdf3(gxy, log1)(H(log4))}kdf4(gxy, log1)

    • Data encrypted with kdf5(gxy, log5)

  • S → C: Data encrypted with kdf6(gxy, log5)

log(x) is a log of all previous messages.