Part 5 : Sharing resources, security principles and protocols

Olivier Bonaventure
Olivier BonaventureProfessor at Université catholique de Louvain (UCL) and co-founder at Tessares
Week 5
Sharing resources
Security principles
Security protocols
Agenda
• Sharing resources
• Network security principles
• Security protocols
How to achieve
max-min fairness ?
• Two possible approaches
• Modify the routers to reach max-min
fairness
• Modify the endhosts to reach max-min
fairness
Simple Router
output port
Buffer
Input links Output link
Buffer acceptance
accepts or rejects
incoming packets
Router output port
Q[1]
Q[2]
Q[3]
Q[N]
Flow identification
Input links
Output link
Flow identification
Identifies the flow
to which the arriving packet
belongs
Buffer acceptance
accepts or rejects
incoming packets
Queuing strategy
Logical organization of the
router's buffers
Scheduler
Chooses the packet to
be transmitted first on
the output link
Round robin
Flow 2
Flow 1
Flow 3
Flow 4
Flow 5
Flow 1
Flow 2
Flow 3
Flow N
Scheduler :
F1
F2
F3
F4
FN
Example
F1
F2
F3
Flow2 (L=2)
Flow1(L=1)
Flow3 (L=1) F1
F2
F3
Flow1 and Flow3 send packets of size 1
Flow 2 sends packets of size 2
Round-Robin
• Advantage
• Can provide fairness independently of the
characteristics of the flows
• Extensions like Deficit Round Robin
support variable length packets
• Drawback
• Difficult to scale to a very large number of
flows
Agenda
• Sharing resources
• Network security principles
• Crypto building blocks
• Client authentication
• Server authentication
• Key exchange
• Security protocols
The security landscape
• Legitimate users
• Attacker
B
Bob Alice
Terrence
T
A
Security threat: Privacy
• Security issue
• Alice sends a confidential message to Bob
• How to prevent Terrence from reading the
message ?
B
T
A
Authentication
• Security issue
• Terrence sends a message to Bob
impersonating Alice
• How to prevent Terrence from spoofing
messages or how can Bob verify that the
message originates from Alice and not
Terrence ?
B
T
A
Message
integrity
• Alice sends a message to Bob, but
Terrence changes the message before it
reaches Bob
• How to prevent Terrence from changing
the message or how to allow Bob to check
that the message sent by Alice was not
modified ?
B
T
A
Denial of
Service
• Terrence sends so many messages to
Bob that Bob is unable to process the
messages sent by Alice
• How to prevent Terrence from overloading
Bob so that Alice cannot contact Bob ?
B
T
Hash functions
• Properties
• Easy to compute H(Msg,key)
• Very difficult to find Msg2 :
H(Msg,k)=H(Msg2,k)
• Example hash functions
• MD5, MD4, SHA-1,SHA-256
Alice Bob
H H
m
key key
m,H(m,key)
insecure
channel
Can we use CRC as a hash function ?
MD5
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
16 64 256 1024 8192
MD5 - Throughput in Gbps
MD5
SHA1 and SHA256
0
1
2
3
4
5
6
7
16 64 256 1024 8192
SHA - Throughput in Gbps
SHA-1
SHA512
Benchmarks can be computed using openssl speed command
Secret-key crypto
• Examples : DES, AES, RC-4, IDEA,
CHACHA
Alice Bob
E D
m
key key
E(m,key)
insecure
channel
m
Cipher performance
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
16 64 256 1024 8192
Cipher - Throughput in Gbps
RC4
DES
AES
AES-256
Public-key crypto
• Each user maintains two keys
• A public key (PublicKey) which can be
made public and can be used by any
user to send him/her encrypted
messages
• A private key (PrivateKey) which is kept
secret and can be used to decrypt
information encrypted with the public
Public-key crypto
Encryption
• Examples
• RSA, ECC
Alice Bob
E D
m
PubBob PrivBob
E(m,PubBob)
unsecure
channel
m
Public-key crypto
Signatures
• Examples
• RSA, DSS
Alice Bob
S V
m
PrivAlice PubAlice
S(m,PrivAlice)
insecure
channel
yes
no
RSA
0
20000
40000
60000
80000
100000
120000
140000
160000
180000
512 1024 2048 4096
verify/s
sign/s
Agenda
• Sharing resources
• Network security principles
• Crypto building blocks
• Client authentication
• Server authentication
• Key exchange
• Security protocols
Password authentication
Alice Bob
Hello from Alice, password = blabla Info about Alice
pass=blabla
Never ever store
a password in
clear in a file
What are the security risks with
password based authentication ?
Attacks
• Man in the middle attack
Terrence
Alice Bob
Hello from Alice, password =
blabla
If Terrence can capture the
message, then he will know the
password and ...
Info from Alice, password =
blabla
Can we improve this by using hash
functions ?
Hashed Password
Alice Bob
Hello from Alice, password =
Hash(blabla)
Info about Alice
pass=Hash(blabla)
Is this solution secure against a MITM
attack ?
One-time passwords
• Server stores for each user
• username
• n /* number of allowed authentications */
• hashn(pwd) /*
hash3(pwd)=hash(hash(hash(pwd))*/
An implementation of this scheme is described in :
N. Haller, C. Metz, P. Nesser, M. Straw. A One-Time Password
System. RFC 2289.February 1998.
One-time passwords
• When user wishes to be authenticated
• Server sends stored value of n
• User sends hashn-1(pwd)
• Server compares hash(hashn-1(pwd))
with hashn(pwd)
• If equal, user is authenticated,
server decrements n and
remembers
hashn-1(pwd)
One time passwords
Alice Bob
Hello from Alice
My current n is 123
Password : Hash122(P)=VVBG
Info about Alice
n=123
Hash123(P)=ZROK
Info about Alice
n=122
Hash122(P)=VVBG
Can Terrence attack this protocol ?
One-time passwords
Alice Bob
My current n is 8
Password : Hash7(P)=ABCT
Info about Alice
n=122
Hash122
(P)=VVBG
Terrence impersonates Bob
Hello from Alice
Terrence already knows Hash7(P) !
and can compute HashN(P) with N>=7
Current n is 122
Hash121(P)=Z4FT
Hello from Alice
What can Alice do to counter this attack ?
Agenda
• Sharing resources
• Network security principles
• Crypto building blocks
• Client authentication
• Server authentication
• Key exchange
• Security protocols
Server Authentication
Alice Bob
Are you Bob ?
Yes, of
course
• A more secure protocol is necessary
• Solution
• Each server maintains a (public,private) key pair
• PubBob , PrivBob
Server authentication
• Is this a secure authentication (justify) ?
Alice Bob
Are you Bob ?
S(Yes,PrivBob)
PubBob,,PrivBob
Alice must already know PubBob
Server authentication
Alice Bob
Are you Bob ?
S(Yes,PrivBob)
PubBob,,PrivBob
Terrence
Please send PubBob
Possible Man in the Middle Attack
The two messages sent by Bob could
also have been sent by Terrence
Bob's key :
PubBob
Is this secure ?
Server authentication
• Public-key certificates
• To authenticate public keys, Alice and Bob
must trust a third party
• Certificates
l S(PubBob , PrivC)
Alice
Bob
Are you Bob ?
S(Yes,PrivBob)
S(PubBob , PrivC )
PubC, ,PubBob,,PrivBob
S(PubBob , PrivC )
Charles
PubC,,PrivC
PubC,
Is this protocol secure (justify) ?
Are certificates sufficient ?
Alice Bob
Are you Bob ?
Terrence
Are you Bob ? Terrence copies the message sent
by Bob for later...
Terrence sends the saved copy
of Bob's message
S(Yes,PrivBob)
S(PubBob , PrivC )
S(Yes,PrivBob)
S(PubBob , PrivC )
PubC, ,PubBob,,PrivBob
S(PubBob , PrivC )
PubC
,
Improved authentication
• RandomAlice is a nonce
Alice Bob
Are you Bob ?, RandomAlice
Terrence
Terrence copies the message sent
by Bob for later...
This is useless as the next request
sent by Alice will contain a different
random number
S(Yes,RandomAlice ,PrivBob)
S(PubBob , PrivC )
PubC, ,PubBob,,PrivBob
S(PubBob , PrivC )
PubC
Agenda
• Sharing resources
• Network security principles
• Crypto building blocks
• Client authentication
• Server authentication
• Key exchange
• Security protocols
Key Exchange
• How can Alice and Bob safely exchange
a secret key in the presence of Terrence
?
B
T
A
T
Diffie-Hellman
key exchange
• Relies on modulo integer arithmetic
• All users agree on
• A modulus : p
• A base : g
Diffie-Hellman
key exchange
Alice Bob
A=ga mod p
B=gb mod p
a=random int
b=random
int
Secret=Ba mod p Secret=Ab mod p
Diffie-Hellman
g=5, p=23
Alice Bob
A=ga mod p=16
B=gb mod p=21
a=8
b=13
Secret=Ba mod p
=218mod 23=3
Secret=Ab mod p
=1613 mod 23=3
Diffie-Hellman
• Is this safe ?
• Mathematics
• Researchers have tried to break the
scheme for more than 4 decades
• Attackers
• Can Terrence find an attack against
Diffie-Hellman ?
A possible MITM
attack
Alice Bob
A=ga mod p
B=gb mod p
a=random int
b=random
int
SA=Ta mod p SB=Tb mod p
Terrence
t=random
int
T=gt mod p
T=gt mod p
SB=Bt mod p
SA=At mod p
Solving the MITM attack
• What can we do to prevent this Man in
the Middle Attack ?
• Pre-negotiated Shared secret
• Use public keys
• Public/Private keypair on Client
• Public/Private keypair on Server
Authenticated Diffie-
Hellman
Alice Bob
A=ga mod p
S(B=gb mod p, PrivBob)
Cert(PubBob , PrivC )
Secret=Ba mod p Secret=Ab mod p
PubC, ,PubBob,,PrivBob
S(PubBob , PrivC )
Charles
PubC,,PrivC
Agenda
• Sharing resources
• Network security principles
• Security protocols
• Transport Layer Security (TLS)
• ssh
TLS in the stack
Physical layer Physical layer
Datalink Datalink
Network
Network
Physical layer
Datalink
Network
SDU
Transport Transport
Application Application
Segments
TLS TLS
Records
TLS building blocks
• Handshake
• Authenticate server
• Negotiate crypto parameters
• Negotiate encryption and authentication
keys
• Record protocol
• Transmit data securely
Phases of a TLS session
• Handshake
• Session establishment, key negotiation
• Data transfer phase
• Encrypted and authenticated records are
exchanged
• Session termination
• Data transfer stops and session
terminates
TLS handshake
Alice Bob
ClientHello (Ciphers, RandomAlice)
ServerHello(Ciphers,RandomBob )
Certificate(PubBob , PrivC )
PubC, ,PubBob,,PrivBob
S(PubBob , PrivC )
PubC
E( PreMasterSecret , PubBob)
Alice chooses PreMaster Secret
Finished( H(handshake msgs,Key)
Finished( H(handshake msgs,Key))
X.509 Certificates
• C=country, O=organisation , OU=Organisation Unit, ST=State,
L=City
• CN=Common Name
• Sometimes DNS name for a server
• Key usage extensions
• digitalSignature, keyEncipherment, dataEncipherment,
keyCertSign, ...
• Optional Fields
• emailAddress, subjectAltName, ...
ClientHello message
• Protocol Version
• 32 bytes long random number
• 4 bytes Unix time (seconds since 01/01/1970)
• 28 bytes random number
• Session Id
• Each SSL session has an identifier which can be used
later to restart a session
• List of supported Ciphers
• List of supported Compression Methods
ClientHello
• Supported ciphers
• Authentication+Key
Exchange+Cipher+Hash
• TLS RSA WITH NULL MD5
• TLS RSA EXPORT WITH RC4 40 MD5
• TLS RSA WITH RC4 128 MD5
• TLS RSA WITH DES CBC SHA
• TLS RSA WITH 3DES EDE CBC SHA
ServerHello
• Protocol version
• Random
• Session Id
• Optional, sent by server if it allows
sessions to be resumed later
• Cipher Suite
• One of the client cipher suites
Compression Method
Handshake (cont.)
Alice Bob
ClientHello (Ciphers, RandomAlice)
ServerHello(Ciphers,RandomBob )
Certificate(PubBob , PrivC )
ServerHelloDone
PubC, ,PubBob,,PrivBob
S(PubBob , PrivC )
PubC
ClientKeyExchange (E(PreMasterSecret, PubBob))
Data transmission
Data
Data(a) Data(b)
MAC MAC
Hash(Hkey) Hash(Hkey)
Rec.
Header Encrypted(Data(a)+MAC)
Rec.
Header Encrypted(Data(b)+MAC)
Encrypt(Ekey)
Encrypt(Ekey)
• Divide the byte stream in records
• Each record is authenticated • and encrypted
Record Authentication
• How to authenticate records ?
• Key
• Sequence number
• Data
• Cryptographic construction
• HMAC
Key Derivation
PreMaster
Secret
Client
Random
Server
Random
Master
Secret
Key Block
Client
MAC
Server
MAC
Client
Encrypt
Server
Encrypt
Client
IV
Server
IV
Session resumption
Alice Bob
ClientHello (Ciphers, Session:123)
ServerHello(Ciphers,Session:123 )
ChangeCipherSpec
Finished( H(handshake msgs,Key)
PubC, ,PubBob,,PrivBob
S(PubBob , PrivC )
PubC,
Session 123 : MasterKey
ChangeCipherSpec
Finished( H(handshake msgs,Key)
Session 123 : MasterKey
TLS 1.3
• Why changing TLS ?
• TLS was considered to be too slow
• Two round-trip-times
• TLS was considered to be too complex
• Some attacks have affected TLS
• Privacy became a strong focus within
the IETF
Design objectives
• simplify the design by removing unused or unsafe
protocol features
• only a small number of cipher suites
• improve the security of TLS
• no compression or unsafe features
• improve the privacy of the protocol
• perfect forward secrecy
• reduce the latency of TLS
Perfect Forward
Secrecy
• Definition
• An encryption system has the property
of forward secrecy if plain-text
(decrypted) inspection of the data
exchange that occurs during key
agreement phase of session initiation
does not reveal the key that was used
to encrypt the remainder of the session.
Does TLS support
PFS ?
• Not when RSA is used
ClientHello (Ciphers, RandomAlice)
ServerHello(Ciphers,RandomBob )
Certificate(PubBob , PrivC )
E( PreMasterSecret , PubBob)
Alice chooses PreMaster Secret
T
Z
PubC, ,PubBob,,PrivBob
S(PubBob , PrivC )
PubC
• Some TLS ciphers use Diffie-Hellman
Simplifying the
handshake
• Reduce the number of ciphers supported
• Less negotiation between client/server
• Diffie-Hellman is now required
• Client immediately starts Diffie-Hellman
before having validated the server
certificate
TLS 1.3 handshake
Alice Bob
ClientHello (ga mod p, RandomAlice)
ServerHello(gb mod p,RandomBob
)
Certificate(PubBob , PrivC )
Sign(DHkey,Handshake)
Finished
Encrypted Data
PubC, ,PubBob,,PrivBob
S(PubBob , PrivC )
PubC
Alice computes DHkey
Finished, Encrypted Data
Bob computes DHkey
Agenda
• Sharing resources
• Network security
• Security protocols
• Transport Layer Security (TLS)
• ssh
telnet
A telnet session
client server
Connect_req
Connect_resp
Connect_conf
username
Login:
Password:
mypass
• Is this secure ?
SSH
• Basic principles
• Public key used for authentication
• Each host (client/server) has a public
keypair
• Diffie Hellman for key exchange
• Secret key encryption for confidentiality
SSH
client
SSH-2.0-OpenSSH_6.9
SSH-2.0-OpenSSH_6.6.1
SSH2_MSG_KEXINIT
SSH2_MSG_KEXINIT
,PubServer,,PrivServer
SSH : key exchange
• Principles
• Diffie Hellman allows to securely
exchange keys
• but it needs to be authenticated !
• When you use ssh to access
UCLouvain’s servers, how do
you authenticate them ?
Key exchange
client
SSH2_MSG_KEXINIT
B=gb mod p
Sign(Hash(Vclient||Vserver||
KEXClient||KEXServer||PubServer||A||B||K)
SSH2_MSG_KEXINIT
A=ga mod p
,PubServer,,PrivServer
K=Ab mod p
User authentication
• How does the server authenticate the user ?
• Username/password
• Sent over the encrypted channel
• Public key authentication
• User has his/her public/private keypair
• Server knows user's public key and
sends challenge
1 of 76

Recommended

9 ipv6-routing by
9 ipv6-routing9 ipv6-routing
9 ipv6-routingOlivier Bonaventure
2.8K views45 slides
5 sharing-app by
5 sharing-app5 sharing-app
5 sharing-appOlivier Bonaventure
2.2K views57 slides
6 app-tcp by
6 app-tcp6 app-tcp
6 app-tcpOlivier Bonaventure
3K views52 slides
8 congestion-ipv6 by
8 congestion-ipv68 congestion-ipv6
8 congestion-ipv6Olivier Bonaventure
2K views40 slides
Part 7 : HTTP/2, UDP and TCP by
Part 7 : HTTP/2, UDP and TCPPart 7 : HTTP/2, UDP and TCP
Part 7 : HTTP/2, UDP and TCPOlivier Bonaventure
119 views89 slides
Part 4 : reliable transport and sharing resources by
Part 4 : reliable transport and sharing resourcesPart 4 : reliable transport and sharing resources
Part 4 : reliable transport and sharing resourcesOlivier Bonaventure
70 views54 slides

More Related Content

What's hot

Network interview questions by
Network interview questionsNetwork interview questions
Network interview questionsrajasekar1712
647 views3 slides
4 transport-sharing by
4 transport-sharing4 transport-sharing
4 transport-sharingOlivier Bonaventure
1.9K views50 slides
Part 12 : Local Area Networks by
Part 12 : Local Area Networks Part 12 : Local Area Networks
Part 12 : Local Area Networks Olivier Bonaventure
110 views62 slides
Part 9 : Congestion control and IPv6 by
Part 9 : Congestion control and IPv6Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6Olivier Bonaventure
124 views59 slides
TCPLS presentation @ietf 109 by
TCPLS presentation @ietf 109TCPLS presentation @ietf 109
TCPLS presentation @ietf 109Olivier Bonaventure
125 views15 slides
Part 1 : reliable transmission by
Part 1 : reliable transmissionPart 1 : reliable transmission
Part 1 : reliable transmissionOlivier Bonaventure
259 views46 slides

What's hot(20)

Network interview questions by rajasekar1712
Network interview questionsNetwork interview questions
Network interview questions
rajasekar1712647 views
Computer Networking : Principles, Protocols and Practice - lesson 1 by Olivier Bonaventure
Computer Networking : Principles, Protocols and Practice - lesson 1Computer Networking : Principles, Protocols and Practice - lesson 1
Computer Networking : Principles, Protocols and Practice - lesson 1
Beyond TCP: The evolution of Internet transport protocols by Olivier Bonaventure
Beyond TCP: The evolution of Internet transport protocolsBeyond TCP: The evolution of Internet transport protocols
Beyond TCP: The evolution of Internet transport protocols
Olivier Bonaventure18.3K views
Networking Fundamentals: Transport Protocols (TCP and UDP) by Andriy Berestovskyy
Networking Fundamentals: Transport Protocols (TCP and UDP)Networking Fundamentals: Transport Protocols (TCP and UDP)
Networking Fundamentals: Transport Protocols (TCP and UDP)
Computer network (4) by NYversity
Computer network (4)Computer network (4)
Computer network (4)
NYversity512 views
Chapter 9 security by Naiyan Noor
Chapter 9 securityChapter 9 security
Chapter 9 security
Naiyan Noor215 views

Similar to Part 5 : Sharing resources, security principles and protocols

Part2-Apps-Security.pptx by
Part2-Apps-Security.pptxPart2-Apps-Security.pptx
Part2-Apps-Security.pptxOlivier Bonaventure
2 views94 slides
Part2-Apps-Security.pptx by
Part2-Apps-Security.pptxPart2-Apps-Security.pptx
Part2-Apps-Security.pptxOlivier Bonaventure
14 views94 slides
Cryptography Key Management.pptx by
Cryptography Key Management.pptxCryptography Key Management.pptx
Cryptography Key Management.pptxSurendraBasnet6
11 views51 slides
SSL/TLS 101 by
SSL/TLS 101SSL/TLS 101
SSL/TLS 101Chul-Woong Yang
450 views21 slides
SSL/TLS 101 by
SSL/TLS 101SSL/TLS 101
SSL/TLS 101Chul-Woong Yang
1.1K views21 slides
Introduction to security_and_crypto by
Introduction to security_and_cryptoIntroduction to security_and_crypto
Introduction to security_and_cryptoYoung Alista
150 views43 slides

Similar to Part 5 : Sharing resources, security principles and protocols(20)

Introduction to security_and_crypto by Young Alista
Introduction to security_and_cryptoIntroduction to security_and_crypto
Introduction to security_and_crypto
Young Alista150 views
Introduction to security_and_crypto by Fraboni Ec
Introduction to security_and_cryptoIntroduction to security_and_crypto
Introduction to security_and_crypto
Fraboni Ec414 views
Introduction to security_and_crypto by David Hoen
Introduction to security_and_cryptoIntroduction to security_and_crypto
Introduction to security_and_crypto
David Hoen191 views
Introduction to security_and_crypto by Harry Potter
Introduction to security_and_cryptoIntroduction to security_and_crypto
Introduction to security_and_crypto
Harry Potter352 views
Introduction to security_and_crypto by James Wong
Introduction to security_and_cryptoIntroduction to security_and_crypto
Introduction to security_and_crypto
James Wong94 views
Introduction to security_and_crypto by Tony Nguyen
Introduction to security_and_cryptoIntroduction to security_and_crypto
Introduction to security_and_crypto
Tony Nguyen145 views
Introduction to security_and_crypto by Luis Goldster
Introduction to security_and_cryptoIntroduction to security_and_crypto
Introduction to security_and_crypto
Luis Goldster95 views
A TLS Story by ereddick
A TLS StoryA TLS Story
A TLS Story
ereddick68 views
Digital Security 101 by Gary Jan
Digital Security 101Digital Security 101
Digital Security 101
Gary Jan215 views
Cryptography by gaurav singh by Gaurav Singh
Cryptography by gaurav singhCryptography by gaurav singh
Cryptography by gaurav singh
Gaurav Singh122 views
CH02-CompSec4e.pptx by ams1ams11
CH02-CompSec4e.pptxCH02-CompSec4e.pptx
CH02-CompSec4e.pptx
ams1ams112 views

More from Olivier Bonaventure

Part3-reliable.pptx by
Part3-reliable.pptxPart3-reliable.pptx
Part3-reliable.pptxOlivier Bonaventure
10 views55 slides
Part10-router.pptx by
Part10-router.pptxPart10-router.pptx
Part10-router.pptxOlivier Bonaventure
10 views24 slides
Part1-Intro-Apps.pptx by
Part1-Intro-Apps.pptxPart1-Intro-Apps.pptx
Part1-Intro-Apps.pptxOlivier Bonaventure
21 views112 slides
Part9-congestion.pptx by
Part9-congestion.pptxPart9-congestion.pptx
Part9-congestion.pptxOlivier Bonaventure
13 views56 slides
Part11-lan.pptx by
Part11-lan.pptxPart11-lan.pptx
Part11-lan.pptxOlivier Bonaventure
8 views89 slides
Part5-tcp-improvements.pptx by
Part5-tcp-improvements.pptxPart5-tcp-improvements.pptx
Part5-tcp-improvements.pptxOlivier Bonaventure
11 views71 slides

More from Olivier Bonaventure(18)

A personal journey towards more reproducible networking research by Olivier Bonaventure
A personal journey towards more reproducible networking researchA personal journey towards more reproducible networking research
A personal journey towards more reproducible networking research
Part 10 : Routing in IP networks and interdomain routing with BGP by Olivier Bonaventure
Part 10 : Routing in IP networks and interdomain routing with BGPPart 10 : Routing in IP networks and interdomain routing with BGP
Part 10 : Routing in IP networks and interdomain routing with BGP
Part 3 : building a network and supporting applications by Olivier Bonaventure
Part 3 : building a network and supporting applicationsPart 3 : building a network and supporting applications
Part 3 : building a network and supporting applications
Part 2 : reliable transmission and building a network by Olivier Bonaventure
Part 2 : reliable transmission and building a networkPart 2 : reliable transmission and building a network
Part 2 : reliable transmission and building a network

Recently uploaded

information by
informationinformation
informationkhelgishekhar
10 views4 slides
Marketing and Community Building in Web3 by
Marketing and Community Building in Web3Marketing and Community Building in Web3
Marketing and Community Building in Web3Federico Ast
14 views64 slides
How to think like a threat actor for Kubernetes.pptx by
How to think like a threat actor for Kubernetes.pptxHow to think like a threat actor for Kubernetes.pptx
How to think like a threat actor for Kubernetes.pptxLibbySchulze1
5 views33 slides
WEB 2.O TOOLS: Empowering education.pptx by
WEB 2.O TOOLS: Empowering education.pptxWEB 2.O TOOLS: Empowering education.pptx
WEB 2.O TOOLS: Empowering education.pptxnarmadhamanohar21
16 views16 slides
Affiliate Marketing by
Affiliate MarketingAffiliate Marketing
Affiliate MarketingNavin Dhanuka
17 views30 slides
PORTFOLIO 1 (Bret Michael Pepito).pdf by
PORTFOLIO 1 (Bret Michael Pepito).pdfPORTFOLIO 1 (Bret Michael Pepito).pdf
PORTFOLIO 1 (Bret Michael Pepito).pdfbrejess0410
9 views6 slides

Recently uploaded(10)

Marketing and Community Building in Web3 by Federico Ast
Marketing and Community Building in Web3Marketing and Community Building in Web3
Marketing and Community Building in Web3
Federico Ast14 views
How to think like a threat actor for Kubernetes.pptx by LibbySchulze1
How to think like a threat actor for Kubernetes.pptxHow to think like a threat actor for Kubernetes.pptx
How to think like a threat actor for Kubernetes.pptx
LibbySchulze15 views
PORTFOLIO 1 (Bret Michael Pepito).pdf by brejess0410
PORTFOLIO 1 (Bret Michael Pepito).pdfPORTFOLIO 1 (Bret Michael Pepito).pdf
PORTFOLIO 1 (Bret Michael Pepito).pdf
brejess04109 views
Building trust in our information ecosystem: who do we trust in an emergency by Tina Purnat
Building trust in our information ecosystem: who do we trust in an emergencyBuilding trust in our information ecosystem: who do we trust in an emergency
Building trust in our information ecosystem: who do we trust in an emergency
Tina Purnat109 views
The Dark Web : Hidden Services by Anshu Singh
The Dark Web : Hidden ServicesThe Dark Web : Hidden Services
The Dark Web : Hidden Services
Anshu Singh5 views
IETF 118: Starlink Protocol Performance by APNIC
IETF 118: Starlink Protocol PerformanceIETF 118: Starlink Protocol Performance
IETF 118: Starlink Protocol Performance
APNIC394 views

Part 5 : Sharing resources, security principles and protocols

  • 1. Week 5 Sharing resources Security principles Security protocols
  • 2. Agenda • Sharing resources • Network security principles • Security protocols
  • 3. How to achieve max-min fairness ? • Two possible approaches • Modify the routers to reach max-min fairness • Modify the endhosts to reach max-min fairness
  • 4. Simple Router output port Buffer Input links Output link Buffer acceptance accepts or rejects incoming packets
  • 5. Router output port Q[1] Q[2] Q[3] Q[N] Flow identification Input links Output link Flow identification Identifies the flow to which the arriving packet belongs Buffer acceptance accepts or rejects incoming packets Queuing strategy Logical organization of the router's buffers Scheduler Chooses the packet to be transmitted first on the output link
  • 6. Round robin Flow 2 Flow 1 Flow 3 Flow 4 Flow 5 Flow 1 Flow 2 Flow 3 Flow N Scheduler : F1 F2 F3 F4 FN
  • 7. Example F1 F2 F3 Flow2 (L=2) Flow1(L=1) Flow3 (L=1) F1 F2 F3 Flow1 and Flow3 send packets of size 1 Flow 2 sends packets of size 2
  • 8. Round-Robin • Advantage • Can provide fairness independently of the characteristics of the flows • Extensions like Deficit Round Robin support variable length packets • Drawback • Difficult to scale to a very large number of flows
  • 9. Agenda • Sharing resources • Network security principles • Crypto building blocks • Client authentication • Server authentication • Key exchange • Security protocols
  • 10. The security landscape • Legitimate users • Attacker B Bob Alice Terrence T A
  • 11. Security threat: Privacy • Security issue • Alice sends a confidential message to Bob • How to prevent Terrence from reading the message ? B T A
  • 12. Authentication • Security issue • Terrence sends a message to Bob impersonating Alice • How to prevent Terrence from spoofing messages or how can Bob verify that the message originates from Alice and not Terrence ? B T A
  • 13. Message integrity • Alice sends a message to Bob, but Terrence changes the message before it reaches Bob • How to prevent Terrence from changing the message or how to allow Bob to check that the message sent by Alice was not modified ? B T A
  • 14. Denial of Service • Terrence sends so many messages to Bob that Bob is unable to process the messages sent by Alice • How to prevent Terrence from overloading Bob so that Alice cannot contact Bob ? B T
  • 15. Hash functions • Properties • Easy to compute H(Msg,key) • Very difficult to find Msg2 : H(Msg,k)=H(Msg2,k) • Example hash functions • MD5, MD4, SHA-1,SHA-256 Alice Bob H H m key key m,H(m,key) insecure channel
  • 16. Can we use CRC as a hash function ?
  • 17. MD5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 16 64 256 1024 8192 MD5 - Throughput in Gbps MD5
  • 18. SHA1 and SHA256 0 1 2 3 4 5 6 7 16 64 256 1024 8192 SHA - Throughput in Gbps SHA-1 SHA512 Benchmarks can be computed using openssl speed command
  • 19. Secret-key crypto • Examples : DES, AES, RC-4, IDEA, CHACHA Alice Bob E D m key key E(m,key) insecure channel m
  • 20. Cipher performance 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 16 64 256 1024 8192 Cipher - Throughput in Gbps RC4 DES AES AES-256
  • 21. Public-key crypto • Each user maintains two keys • A public key (PublicKey) which can be made public and can be used by any user to send him/her encrypted messages • A private key (PrivateKey) which is kept secret and can be used to decrypt information encrypted with the public
  • 22. Public-key crypto Encryption • Examples • RSA, ECC Alice Bob E D m PubBob PrivBob E(m,PubBob) unsecure channel m
  • 23. Public-key crypto Signatures • Examples • RSA, DSS Alice Bob S V m PrivAlice PubAlice S(m,PrivAlice) insecure channel yes no
  • 25. Agenda • Sharing resources • Network security principles • Crypto building blocks • Client authentication • Server authentication • Key exchange • Security protocols
  • 26. Password authentication Alice Bob Hello from Alice, password = blabla Info about Alice pass=blabla Never ever store a password in clear in a file What are the security risks with password based authentication ?
  • 27. Attacks • Man in the middle attack Terrence Alice Bob Hello from Alice, password = blabla If Terrence can capture the message, then he will know the password and ... Info from Alice, password = blabla Can we improve this by using hash functions ?
  • 28. Hashed Password Alice Bob Hello from Alice, password = Hash(blabla) Info about Alice pass=Hash(blabla) Is this solution secure against a MITM attack ?
  • 29. One-time passwords • Server stores for each user • username • n /* number of allowed authentications */ • hashn(pwd) /* hash3(pwd)=hash(hash(hash(pwd))*/ An implementation of this scheme is described in : N. Haller, C. Metz, P. Nesser, M. Straw. A One-Time Password System. RFC 2289.February 1998.
  • 30. One-time passwords • When user wishes to be authenticated • Server sends stored value of n • User sends hashn-1(pwd) • Server compares hash(hashn-1(pwd)) with hashn(pwd) • If equal, user is authenticated, server decrements n and remembers hashn-1(pwd)
  • 31. One time passwords Alice Bob Hello from Alice My current n is 123 Password : Hash122(P)=VVBG Info about Alice n=123 Hash123(P)=ZROK Info about Alice n=122 Hash122(P)=VVBG Can Terrence attack this protocol ?
  • 32. One-time passwords Alice Bob My current n is 8 Password : Hash7(P)=ABCT Info about Alice n=122 Hash122 (P)=VVBG Terrence impersonates Bob Hello from Alice Terrence already knows Hash7(P) ! and can compute HashN(P) with N>=7 Current n is 122 Hash121(P)=Z4FT Hello from Alice What can Alice do to counter this attack ?
  • 33. Agenda • Sharing resources • Network security principles • Crypto building blocks • Client authentication • Server authentication • Key exchange • Security protocols
  • 34. Server Authentication Alice Bob Are you Bob ? Yes, of course • A more secure protocol is necessary • Solution • Each server maintains a (public,private) key pair • PubBob , PrivBob
  • 35. Server authentication • Is this a secure authentication (justify) ? Alice Bob Are you Bob ? S(Yes,PrivBob) PubBob,,PrivBob Alice must already know PubBob
  • 36. Server authentication Alice Bob Are you Bob ? S(Yes,PrivBob) PubBob,,PrivBob Terrence Please send PubBob Possible Man in the Middle Attack The two messages sent by Bob could also have been sent by Terrence Bob's key : PubBob Is this secure ?
  • 37. Server authentication • Public-key certificates • To authenticate public keys, Alice and Bob must trust a third party • Certificates l S(PubBob , PrivC) Alice Bob Are you Bob ? S(Yes,PrivBob) S(PubBob , PrivC ) PubC, ,PubBob,,PrivBob S(PubBob , PrivC ) Charles PubC,,PrivC PubC, Is this protocol secure (justify) ?
  • 38. Are certificates sufficient ? Alice Bob Are you Bob ? Terrence Are you Bob ? Terrence copies the message sent by Bob for later... Terrence sends the saved copy of Bob's message S(Yes,PrivBob) S(PubBob , PrivC ) S(Yes,PrivBob) S(PubBob , PrivC ) PubC, ,PubBob,,PrivBob S(PubBob , PrivC ) PubC ,
  • 39. Improved authentication • RandomAlice is a nonce Alice Bob Are you Bob ?, RandomAlice Terrence Terrence copies the message sent by Bob for later... This is useless as the next request sent by Alice will contain a different random number S(Yes,RandomAlice ,PrivBob) S(PubBob , PrivC ) PubC, ,PubBob,,PrivBob S(PubBob , PrivC ) PubC
  • 40. Agenda • Sharing resources • Network security principles • Crypto building blocks • Client authentication • Server authentication • Key exchange • Security protocols
  • 41. Key Exchange • How can Alice and Bob safely exchange a secret key in the presence of Terrence ? B T A T
  • 42. Diffie-Hellman key exchange • Relies on modulo integer arithmetic • All users agree on • A modulus : p • A base : g
  • 43. Diffie-Hellman key exchange Alice Bob A=ga mod p B=gb mod p a=random int b=random int Secret=Ba mod p Secret=Ab mod p
  • 44. Diffie-Hellman g=5, p=23 Alice Bob A=ga mod p=16 B=gb mod p=21 a=8 b=13 Secret=Ba mod p =218mod 23=3 Secret=Ab mod p =1613 mod 23=3
  • 45. Diffie-Hellman • Is this safe ? • Mathematics • Researchers have tried to break the scheme for more than 4 decades • Attackers • Can Terrence find an attack against Diffie-Hellman ?
  • 46. A possible MITM attack Alice Bob A=ga mod p B=gb mod p a=random int b=random int SA=Ta mod p SB=Tb mod p Terrence t=random int T=gt mod p T=gt mod p SB=Bt mod p SA=At mod p
  • 47. Solving the MITM attack • What can we do to prevent this Man in the Middle Attack ? • Pre-negotiated Shared secret • Use public keys • Public/Private keypair on Client • Public/Private keypair on Server
  • 48. Authenticated Diffie- Hellman Alice Bob A=ga mod p S(B=gb mod p, PrivBob) Cert(PubBob , PrivC ) Secret=Ba mod p Secret=Ab mod p PubC, ,PubBob,,PrivBob S(PubBob , PrivC ) Charles PubC,,PrivC
  • 49. Agenda • Sharing resources • Network security principles • Security protocols • Transport Layer Security (TLS) • ssh
  • 50. TLS in the stack Physical layer Physical layer Datalink Datalink Network Network Physical layer Datalink Network SDU Transport Transport Application Application Segments TLS TLS Records
  • 51. TLS building blocks • Handshake • Authenticate server • Negotiate crypto parameters • Negotiate encryption and authentication keys • Record protocol • Transmit data securely
  • 52. Phases of a TLS session • Handshake • Session establishment, key negotiation • Data transfer phase • Encrypted and authenticated records are exchanged • Session termination • Data transfer stops and session terminates
  • 53. TLS handshake Alice Bob ClientHello (Ciphers, RandomAlice) ServerHello(Ciphers,RandomBob ) Certificate(PubBob , PrivC ) PubC, ,PubBob,,PrivBob S(PubBob , PrivC ) PubC E( PreMasterSecret , PubBob) Alice chooses PreMaster Secret Finished( H(handshake msgs,Key) Finished( H(handshake msgs,Key))
  • 54. X.509 Certificates • C=country, O=organisation , OU=Organisation Unit, ST=State, L=City • CN=Common Name • Sometimes DNS name for a server • Key usage extensions • digitalSignature, keyEncipherment, dataEncipherment, keyCertSign, ... • Optional Fields • emailAddress, subjectAltName, ...
  • 55. ClientHello message • Protocol Version • 32 bytes long random number • 4 bytes Unix time (seconds since 01/01/1970) • 28 bytes random number • Session Id • Each SSL session has an identifier which can be used later to restart a session • List of supported Ciphers • List of supported Compression Methods
  • 56. ClientHello • Supported ciphers • Authentication+Key Exchange+Cipher+Hash • TLS RSA WITH NULL MD5 • TLS RSA EXPORT WITH RC4 40 MD5 • TLS RSA WITH RC4 128 MD5 • TLS RSA WITH DES CBC SHA • TLS RSA WITH 3DES EDE CBC SHA
  • 57. ServerHello • Protocol version • Random • Session Id • Optional, sent by server if it allows sessions to be resumed later • Cipher Suite • One of the client cipher suites Compression Method
  • 58. Handshake (cont.) Alice Bob ClientHello (Ciphers, RandomAlice) ServerHello(Ciphers,RandomBob ) Certificate(PubBob , PrivC ) ServerHelloDone PubC, ,PubBob,,PrivBob S(PubBob , PrivC ) PubC ClientKeyExchange (E(PreMasterSecret, PubBob))
  • 59. Data transmission Data Data(a) Data(b) MAC MAC Hash(Hkey) Hash(Hkey) Rec. Header Encrypted(Data(a)+MAC) Rec. Header Encrypted(Data(b)+MAC) Encrypt(Ekey) Encrypt(Ekey) • Divide the byte stream in records • Each record is authenticated • and encrypted
  • 60. Record Authentication • How to authenticate records ? • Key • Sequence number • Data • Cryptographic construction • HMAC
  • 62. Session resumption Alice Bob ClientHello (Ciphers, Session:123) ServerHello(Ciphers,Session:123 ) ChangeCipherSpec Finished( H(handshake msgs,Key) PubC, ,PubBob,,PrivBob S(PubBob , PrivC ) PubC, Session 123 : MasterKey ChangeCipherSpec Finished( H(handshake msgs,Key) Session 123 : MasterKey
  • 63. TLS 1.3 • Why changing TLS ? • TLS was considered to be too slow • Two round-trip-times • TLS was considered to be too complex • Some attacks have affected TLS • Privacy became a strong focus within the IETF
  • 64. Design objectives • simplify the design by removing unused or unsafe protocol features • only a small number of cipher suites • improve the security of TLS • no compression or unsafe features • improve the privacy of the protocol • perfect forward secrecy • reduce the latency of TLS
  • 65. Perfect Forward Secrecy • Definition • An encryption system has the property of forward secrecy if plain-text (decrypted) inspection of the data exchange that occurs during key agreement phase of session initiation does not reveal the key that was used to encrypt the remainder of the session.
  • 66. Does TLS support PFS ? • Not when RSA is used ClientHello (Ciphers, RandomAlice) ServerHello(Ciphers,RandomBob ) Certificate(PubBob , PrivC ) E( PreMasterSecret , PubBob) Alice chooses PreMaster Secret T Z PubC, ,PubBob,,PrivBob S(PubBob , PrivC ) PubC • Some TLS ciphers use Diffie-Hellman
  • 67. Simplifying the handshake • Reduce the number of ciphers supported • Less negotiation between client/server • Diffie-Hellman is now required • Client immediately starts Diffie-Hellman before having validated the server certificate
  • 68. TLS 1.3 handshake Alice Bob ClientHello (ga mod p, RandomAlice) ServerHello(gb mod p,RandomBob ) Certificate(PubBob , PrivC ) Sign(DHkey,Handshake) Finished Encrypted Data PubC, ,PubBob,,PrivBob S(PubBob , PrivC ) PubC Alice computes DHkey Finished, Encrypted Data Bob computes DHkey
  • 69. Agenda • Sharing resources • Network security • Security protocols • Transport Layer Security (TLS) • ssh
  • 71. A telnet session client server Connect_req Connect_resp Connect_conf username Login: Password: mypass • Is this secure ?
  • 72. SSH • Basic principles • Public key used for authentication • Each host (client/server) has a public keypair • Diffie Hellman for key exchange • Secret key encryption for confidentiality
  • 74. SSH : key exchange • Principles • Diffie Hellman allows to securely exchange keys • but it needs to be authenticated ! • When you use ssh to access UCLouvain’s servers, how do you authenticate them ?
  • 75. Key exchange client SSH2_MSG_KEXINIT B=gb mod p Sign(Hash(Vclient||Vserver|| KEXClient||KEXServer||PubServer||A||B||K) SSH2_MSG_KEXINIT A=ga mod p ,PubServer,,PrivServer K=Ab mod p
  • 76. User authentication • How does the server authenticate the user ? • Username/password • Sent over the encrypted channel • Public key authentication • User has his/her public/private keypair • Server knows user's public key and sends challenge

Editor's Notes

  1. How to determine a max-min fair bandwidth allocation for a given network ? Algorithm [Bertsekas & Gallager, Data Networks, 2nd edition, Prentice Hall 1992] First start with an allocation of 0 Mbps for each source Then equally increment the allocation to each source until one link becomes saturated. At this point, each source which uses the saturated link receives an allocation equal to the bandwidth of this saturated link divided by the number of sources using this bottleneck link. Next, the allocation of all the sources which do not use a saturated link is equally incremented until another link becomes saturated. The algorithm continues from step to step, always incrementing the allocation of the sources which do not use a saturated link, until all sources use at least one of the saturated links.
  2. An implementation of this scheme is described in : N. Haller, C. Metz, P. Nesser, M. Straw. A One-Time Password System. RFC 2289.February 1998.
  3. In the example above, hash(VVBG)=ZROK
  4. To avoid this Problem, Alice must remember the last value of n used by each server with whom she is communicating and should be warned when the server requests a different value of n that the previous value.
  5. The public-private key pair can be a RSA key-pair for example.
  6. In this slide and the subsequent ones,S(Yes,PrivBob) is a signed message that contains “Yes” and is signed by using the ,PrivBob private key . The validity of this signature can be checked by using ,PubBob
  7. A Man in the Middle or Woman in the Middle attack is possible in this case as Terrence can easily intercept the messages sent by Alice and replace them with fake messages that contain her public key and signature.
  8. In the example above, we use S(PubBob , PrivC) to indicate a certificate for Bob's key issued by Charles. Charles usually checks the identity of Bob offline and then creates the certificate. Charles is sometimes referred to as a Trusted Third Party (TTP).
  9. Replay attacks are common threats to security protocols.
  10. The nonce is a random number. Note that to be secure, this nonce should be truly random. In practice, generating random numbers is not easy, For a detailed discussion, see : RFC1750 Randomness Recommendations for Security. D. Eastlake, S. Crocker, J. Schiller. December 1994.
  11. UDP is defined in J. Postel, User Datagram Protocol. RFC768, August 1980 It will be described in more details later
  12. TCP is defined in J. Postel, Transmission Control Protocol, RFC793, September 1981 It will be described in more details later
  13. The RR MX were proposed in C. Partridge. Mail routing and the domain system. Request for Comments 974, Internet Engineering Task Force, January 1986. A complete list of DNS RR may be found at http://www.its.uq.edu.au/tn-0011
  14. MIME was defined in N. Freed and N. Borenstein. Multipurpose internet mail extensions (MIME) part one: Format of internet message bodies. Request for Comments 2045, Internet Engineering Task Force, November 1996. N. Freed and N. Borenstein. Multipurpose internet mail extensions (MIME) part two: Media types. Request for Comments 2046, Internet Engineering Task Force, November 1996.
  15. Exemple de message MIME Received: from loriot.info.fundp.ac.be (loriot.info.fundp.ac.be [138.48.32.96]) by leibniz.info.fundp.ac.be (8.9.1/8.9.1) with SMTP id QAA19679; Mon, 20 Sep 1999 16:37:25 +0200 (MET DST) Message-Id: <3.0.5.32.19990920163316.00866340@info.fundp.ac.be> Date: Mon, 20 Sep 1999 16:33:16 +0200 To: pers-aca, pers-sci From: Gysele HENRARD <ghe@info.fundp.ac.be> Subject: listes Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_937830796==_" --=====================_937830796==_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Bonjour, Voici des listes de 1M-1L, 2M-2L et ERASMUS mises =E0 jour ce lundi 20 septembre. Gyselle --=====================_937830796==_ Content-Type: application/octet-stream; name="1M_99_00.xls"; x-mac-type="584C5334"; x-mac-creator="5843454C" ...
  16. HTTP 1.0 is defined in : T. Berners-Lee, R. Fielding, and H. Frystyk. Hypertext transfer protocol -- HTTP/1.0. Request for Comments 1945, Internet Engineering Task Force, May 1996.
  17. HTTP 1.1 is defined in : R. Fielding, J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach, and T. Berners-Lee. Hypertext transfer protocol -- HTTP/1.1. Request for Comments 2616, Internet Engineering Task Force, June 1999.