Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS :...
Transcript of Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS :...
![Page 1: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/1.jpg)
Protocoles et Tunnels de Sécurité
Références R,E. Corvalan et Y. Le Corvic.« Les VPN, Principes, conception et déploiement des réseaux privés virtuels». S. Thomas. « SSL and TLS Essentials ».G. Berton. Security Protocols: the case of Secure Sockets Layer (SSL) and Transport Layer Security (TLS)
![Page 2: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/2.jpg)
Tunnels sur la couche Transport SSL/TLS
(Secure Socket Layer/Transport Layer Security)
![Page 3: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/3.jpg)
SSL/TLS : Introduction
Le Protocole SSL est développé en 1994 par Netscape. Permet la mise en œuvre de tunnels au niveau 4 du modèle
OSI. N'est utilisable que pour la sécurisation du flux TCP. Largement utilisé pour HTTP qui devient HTTPS (port 443) Peut être implémenté pour d'autres protocoles applicatifs
comme POP,FTP,SMTP,LDAP... La dernière version de SSL est 3. Ses fonctionnalités sont très
similaires à celles du protocole TLS (Transport Layer Security) version 1. On dit souvent que : SSLv3=TLSv1
En 2013, dernière version de TLS est TLSv1.2
![Page 4: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/4.jpg)
Ports au dessus de SSL
![Page 5: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/5.jpg)
Ports au dessus de SSL
![Page 6: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/6.jpg)
SSL/TLS: Architecture
IP
TCP
SSL ou TLS
HTTP FTP SMTP
![Page 7: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/7.jpg)
SSL/TLS: Architecture
TCP
Hand-shake
HTTP FTP SMTP
TRAITEMENT DES COMMUNICATIONS AVECL'APPLICATION
INITIALISATION DES COMMUNICATIONS CLIENT/SERVEUR
INITIALISATION DE LA COMMUNICATION SECURISÉE
TRAITEMENT DE LA COMPRESSION,CRYPTAGE
ET CONTRÔLE D'INTÉGRITÉ
TRAITEMENT DES ERREURS
Change Cipher
AlertAppli-cation
Record Layer
![Page 8: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/8.jpg)
SSL/TLSPropriétés de sécurité fournies
Échange sécurisé de clés de chiffrement
Authentification du serveur (optionnelle mais souvent utilisée)
Authentification du client ( optionnelle et très peu utilisée)
Confidentialité et Intégrité des messages
![Page 9: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/9.jpg)
Mécanisme d'établissement d'un tunnel TLS
12
3
4
567
9
Client Hello
Server Hello
Certificat Serveur
Server Hello Done
ClientKeyExchange
Change Cipher Spec
FIN
Change Cipher Spec
FIN
Cryptage Symétriques desEchanges Applicatifs
Client ServeurCipherSuite +Client Random
Client Hello Choix CipherSuite +Server Random
Certificat incluant KpubS, sinon, envoie de
Server Key Exchange
Négociation terminée
8
{preMasterKey}KpubS
Activation du cryptage
Activation du cryptage
Utilisation de 6 clés
![Page 10: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/10.jpg)
TLSRecord Layer/Handshake Protocol
Client Hello
![Page 11: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/11.jpg)
Analyse de trafic TLSRecord Layer/Handshake Protocol
Server Hello
RSA : Algorithme Asymétrique (Authentification)
AES: Algorithme symétrique avec le mode opérateur CBC (Cipher Block Chaining) et une taille de clé de 128bits (Confidentialité)
SHA: Algorithme de hachage (Intégrité)
![Page 12: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/12.jpg)
Analyse de trafic TLSRecord Layer/Handshake Protocol
Certificate
KpubS : Clé publique du serveur
![Page 13: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/13.jpg)
Analyse de trafic TLSRecord Layer/Handshake Protocol
Client Key Exchange
PreMasterKey choisi par le client crypté par KpubS
![Page 14: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/14.jpg)
TLSGénération des 6 clés de session
KDF(Key Derivation Function) • A partir de preMasterKey, le client et le serveur génère simultanément une clé appelée MasterKey.
•A partir de MasterKey, ils générent les 6 clés suivantes : Client Cipher : utilisée pour chiffrer les données du client vers le
serveur.
Server Cipher: utilisée pour chiffrer les données du serveur vers le client.
Client MAC : utilisée dans la fonction cryptographique de hachage HMAC coté client pour le contrôle d'intégrité.
Server MAC : utilisée dans la fonction cryptographique de hachage HMAC par le serveur pour le contrôle d'intégrité.
Client IV : Vecteur d'initialisation utilisé par le client au niveau du mode CBC lors du chiffrement symétrique des données.
Server IV : Vecteur d'initialisation utilisé par le serveur au niveau du
mode CBC lors du chiffrement symétrique des données.
![Page 15: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/15.jpg)
« La fonction HMAC est définit ainsi :
avec :
h : une fonction de hachage itérative(MD5,SHA),
K : la clé secrète complétée avec des zéros pour qu'elle atteigne la taille de bloc de la fonction h. Dans notre cas, il s'agit soit de la clé client MAC ou server MAC
m : le message à authentifier,
"||" désigne une concaténation,
ipad et opad, chacune de la taille d'un bloc, sont définies par : ipad = 0x363636...3636 et opad = 0x5c5c5c...5c5c. Donc, si la taille de bloc de la fonction de hachage est 512, ipad et opad sont 64 répétitions des octets, respectivement, 0x36 et 0x5c. »
Rappels HMAC(HashBased Message Authentication Code)
(Wikipédia)
![Page 16: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/16.jpg)
Le message m à chiffrer est découpé en block (m0,m1..). Un bloc dépend de tous les précédents . Mode randomisé par la présence d’une valeur aléatoire initiale IV. Dans notre cas, il sagit soit du client IV ou Server IV.
Ek est un algorithme de chiffrement symétrique au choix (DES,3DES,AES...)
Rappels mode de chiffrement CBC (Chipher Block Chaining)
(Wikipédia)
![Page 17: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/17.jpg)
SSL/TLSGénération des 6 clés de session
KDF(Key Derivation Function) preMasterKey Client Random Server Random
MasterKey
Key Material
MasterKey
Client MAC
Client Cipher
Client IV
Client MAC
Client Cipher
Client IV
![Page 18: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/18.jpg)
SSLDérivation de MasterKey
preMasterKey Client Random
preMasterKey Client Random Server Random'A'
SHA
preMasterKey Client Random Server Random'BB' preMasterKey Client Random Server Random'BB'
Server Random'CCC'
preMasterKey hash
preMasterKey hash
preMasterKey hashMD5
hash hash hash MasterKey
![Page 19: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/19.jpg)
SSLDérivation de Key Material
MasterKey Client RandomServer Random'A'
SHA
'BB''BB'
'CCC'
MasterKey hash
MasterKey hash
MasterKey hashMD5
hash hash hash Key Material
hash hash ….
MasterKey Client RandomServer Random
MasterKey Client RandomServer Random
….
![Page 20: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/20.jpg)
SSLRécupération des 6 clés
hash hash hash hash hash hash hash hash hash hash hash hash
Key Material
Client MAC
Client Cipher
Client IV
serverMAC
server Cipher
serverIV
![Page 21: Protocoles et Tunnels de Sécuritéhdhili.weebly.com/uploads/9/8/9/6/9896432/ssl.pdf · SSL/TLS : Introduction Le Protocole SSL est développé en 1994 par Netscape. Permet la mise](https://reader035.fdocuments.in/reader035/viewer/2022070721/5ee2ddcaad6a402d666d1688/html5/thumbnails/21.jpg)
TLSRecord ProtocolEchange sécurisé des données
Avec Algorithme négocié dans la phase hello
HMAC(clientMAC ou ServerMAC,M0 compressé,d'autres infos)
M0 M1 M2
Algorithme Symétrique négocié(AES,DES..) utilisant la clé Client Cipher ou Server Cipher et utilisant Client IV ou sever IV si le mode CBC est demandé
M