Secret key:
011010100010
Secret key:
011010100010
Secret key:
011010100010
Message 1:
101
Secret key:
011010100010
101 XOR 011 =110
Bob decipher:
110 XOR 011 = 101
Secret key:
011010100010
Message 2:
111
Secret key:
011010100010
111 XOR 010 =101
Bob decipher:
101 XOR 010 = 111
Secret key:
Message:
Result:
XOR
=
XOR
=
Secret key:
Message:
Result:
XOR
=
XOR
=
XOR
=
Secret key:
Message:
Result:
XOR
=
XOR
=
M1 S M1 XOR S
M2 S M2 XOR S
M1 XOR S XOR M2 XOR S = M1 XOR M2
Historical algorithms (substitution, XOr, Vigenere, Enigma...)
Historical algorithms (substitution, XOr, Vigenere, Enigma...)
Modern algorithms (DES, AES, ...)
Input (64 bits)
000100111011
Left half (32 bits)
000100
Right half (32 bits)
111011
Input (64 bits)
000100111011
Left half (32 bits)
000100
Right half (32 bits)
111011
Out left (32 bits)
111011
Input (64 bits)
000100111011
Left half (32 bits)
000100
Right half (32 bits)
111011
Cipher
Function
Secret Key
Out left (32 bits)
111011
Input (64 bits)
000100111011
Left half (32 bits)
000100
Right half (32 bits)
111011
Cipher
Function
Secret Key
XOR
Out right (32 bits)
011100
Out left (32 bits)
111011
Input (64 bits)
000100111011
Left half (32 bits)
000100
Right half (32 bits)
111011
Cipher
Function
Secret Key
XOR
Out right (32 bits)
011100
Out left (32 bits)
111011
A single round of DES
Input (64 bits)
Initial Permutation
{
16 rounds
Final Permutation
Output (64 bits)
Input (64 bits)
Initial Permutation
{
16 rounds
Final Permutation
Output (64 bits)
Key (56 bits)
Sub-key 1
Sub-key 16
Input (64 bits)
Initial Permutation
{
16 rounds
Final Permutation
Output (64 bits)
Key (56 bits)
Sub-key 1
Sub-key 16
Key schedule
Secret key:
011010100010
Secret key:
011010100010
c = AES(message, secret_key)
Bob decipher:
message = AES_decipher(c, secret_key)
Secret key:
011010100010
Secret key:
011010100010
c = AES(message, secret_key)
Bob decipher:
message = AES_decipher(c, secret_key)
?
(e.g. RSA)
Public RSA key \(K_p\)
Secret RSA key \(K_s\)
(e.g. RSA)
Public RSA key \(K_p\)
Secret RSA key \(K_s\)
(e.g. RSA)
Public RSA key \(K_p\)
Secret RSA key \(K_s\)
\(ciph\) = RSA_cipher("Hello!", \(K_p\))
RSA_decipher(\(ciph, K_s\))
➡️ "Hello!"
\(ciph\) = RSA_cipher("E563 65AC", \(K_p\))
Public RSA key \(K_p\)
Secret RSA key \(K_s\)
\(ciph\) = RSA_cipher("E563 65AC", \(K_p\))
Public RSA key \(K_p\)
Secret RSA key \(K_s\)
AES-key
\(ciph\) = RSA_cipher("E563 65AC", \(K_p\))
Public RSA key \(K_p\)
Secret RSA key \(K_s\)
AES-key
AES(message, "E536 65AC")
Define yellow as common color
Define yellow as common color
Alice's secret color
Bob's secret color
Define yellow as common color
Alice's secret color
Bob's secret color
My color mixed with the common one
Define yellow as common color
Alice's secret color
Bob's secret color
My color mixed with the common one
My color mixed with the common one
Define yellow as common color
Alice's secret color
Bob's secret color
My color mixed with the common one
My color mixed with the common one
+
Define yellow as common color
Alice's secret color
Bob's secret color
My color mixed with the common one
My color mixed with the common one
\(\ \)
+ =
Define yellow as common color
Alice's secret color
Bob's secret color
My color mixed with the common one
My color mixed with the common one
+ =
= +
secret shared color
Define a base \(g\) and a prime \(p\)
Alice's secret number: \(a\)
Bob's secret number: \(b\)
My color mixed with the common one
Define a base \(g\) and a prime \(p\)
The result of \(g^a~\text{mod} ~p\)
The result of \(g^b~\text{mod} ~p\)
Alice's secret number: \(a\)
Bob's secret number: \(b\)
My color mixed with the common one
\({(g^b)}^a \text{mod} p\) =
= \({(g^a)}^b \text{mod} p\)
secret shared key
Define a base \(g\) and a prime \(p\)
The result of \(g^a~\text{mod} ~p\)
The result of \(g^b~\text{mod} ~p\)
Hi Alice, I'm Bob, let us define shared secret keys!
Hi Bob, I'm Alice, let us define shared secret keys!
Hi Alice, I'm Bob, let us define shared secret keys!
Hi Bob, I'm Alice, let us define shared secret keys!
Need to authenticate the server first
(e.g. RSA)
Public key \(K_p\)
Secret key \(K_s\)
\(ciph\) = RSA_cipher("Hello!", \(K_p\))
RSA_decipher(\(ciph, K_s\))
➡️ "Hello!"
(e.g. RSA)
Public key \(K_p\)
Secret key \(K_s\)
\(ciph\) = RSA_cipher("Hello!", \(K_p\))
RSA_decipher(\(ciph, K_s\))
➡️ "Hello!"
RSA is used to ensure
confidentiality
(e.g. RSA)
Public key \(K_p\)
Secret key \(K_s\)
RSA_cipher(\(sign, K_p\))
➡️ "Hi Bob!"
RSA_decipher("Hi Bob!", \(K_s\)) = \(sign\)
(e.g. RSA)
Public key \(K_p\)
Secret key \(K_s\)
RSA_decipher("Hi Bob!", \(K_s\)) = \(sign\)
RSA_cipher(\(sign, K_p\))
➡️ "Hi Bob!"
RSA is used to ensure
authenticity
Public key \(K_p\)
Secret key \(K_s\)
RSA_cipher(\(sign, K_p\))
➡️ "Hi Bob!"
RSA is used to ensure
authenticity
RSA_decipher("Hi Bob!", \(K_s\)) = \(sign\)
\(sign\)
Public key \(K_p\)
Secret key \(K_s\)
RSA_cipher(\(sign, K_p\))
➡️ "0111001..."
RSA is used to ensure
authenticity
RSA_decipher("0111001...", \(K_s\)) = \(sign\)
"Sign this long random string: 0111001..."
A few well known compagnies
CA | Public key |
---|---|
DigiCert | 1652 az512 |
GeoTrust | a142 684a |
GlobalSign | a654 Fa32 |
A few well known compagnies
0. The server's owner asks for a couple of a RSA public/secret key to a CA.
The PK is signed by the CA.
A few well known compagnies
1. "Hey, here is a very long random string \(c\) (for challenge), sign it plz!"
A few well known compagnies
2. The server compute the signature with its private key
1. "Hey, here is a very long random string \(c\) (for challenge), sign it plz!"
A few well known compagnies
2. The server compute the signature with its private key
1. "Hey, here is a very long random string \(c\) (for challenge), sign it plz!"
3. "Sure, here is the signature of your string and the certified public key."
A few well known compagnies
3. "Sure, here is the signature of your string and the certified public key."
CA | Public key |
---|---|
DigiCert | 1652 az512 |
GeoTrust | a142 684a |
GlobalSign | a654a32 |
4. The browser checks the signature of the challenge
AND the signature of the public key.
Need to trust all the intermediate CAs!
SSL handshake
SSL record