Outils pour utilisateurs

Outils du site


Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
160-tls:040-tls1_2 [le 14/06/2026 à 14:31] – créée prof160-tls:040-tls1_2 [le 14/06/2026 à 14:34] (Version actuelle) – [TLS1.2] prof
Ligne 1: Ligne 1:
-====== Les «Cipher suites» ====== +====== TLS1.2 ====== 
-En français [[https://fr.wikipedia.org/wiki/Suite_cryptographique|«suites cryptographiques»]].+Décrit initialement dans la [[https://www.rfc-editor.org/info/rfc5246/|RFC 5246]] désormais obsolète et mise à jour par de nombreuses autres RFC. Voir le lien pour la liste complète). 
 +{{:160-tls:tls1_2.svg?400 |TLS1.2 avec HTTPS}}Dans le principe, les échanges entre le client et le serveur se font de la manière suivante: 
 +  - Le client s'adresse au serveur en lui présentant les suites de chiffrement qu'il sait utiliser;\\ \\  
 +  - le serveur répond en indiquant la suite sélectionnée et envoie son certificat X509. Une valeur (pseudo)aléatoire est calculée et envoyée également au client:\\ \\  
 +  - le client, avec les informations reçues, finalise une clé de session et l'envoie au serveur;\\ \\  
 +  - le serveur entérine la clé\\ \\  
 +  - le dialogue chiffré avec la clé de session s'établit.
  
-//Une suite cryptographique (cipher suite en anglais) est le nom de la combinaison des algorithmes d'échange de clés, d'authentification, de chiffrement par bloc et génération du code d'authentification de message (MAC) utilisée afin d'établir le paramétrage de sécurité pour une connexion réseau utilisant le protocole de communication Secure Socket Layer (SSL) et Transport Layer Security (TLS).//((Définition de Wikipédia)) 
  
-Le site [[https://ciphersuite.info/cs/?sort=sec-desc|Ciphersuite.io]], au 06/06/2026, en référence 348 différentes dont 15 sont recommandées,  17 sont considérées comme sûres, toutes les autres étant à oublier. 
  
-===== Exemples ===== +===== Dialogue client/serveur ===== 
-Voici quelques exemples parmi les plus recommandés:+Dans ce qui suit, HTTPS est espionné avec **Wireshark**. Le serveur **nginx** est paramétré pour n'utiliser que TLS1.2. Pour améliorer la complexité de la lecture, les protagonistes utilisent leur IPv6: 
 +  * le client : ''2a01:e0a:106b:cdf0:ac2a:a7ff:fedd:e607'', 
 +  * le serveur: ''2a01:e0a:106b:cdf0:7285:c2ff:fe4b:5fdc''
 +(Oui, ils sont dans la même délégation). 
 +==== Client Hello ==== 
 +Dans un premier temps, le client s'adresse au serveur en lui exposant toutes ses possibilités d'exploitation de SSL/TLS: 
 +  * les versions TLS possibles (actuellement (juin 2026) 1.2 ou 1.3, les versions précédentes étant dépassées), 
 +  * les suites de chiffrement, de hachage qu'il est capable de manipuler. 
 +L'objectif étant de trouver un point commun avec le serveur. La capture (partielle) **Wireshark** qui suit montre: 
 +  * les suites cryptographiques que le client sait gérer, 
 +  * les versions TLS supportées, 
 +  * les algorithmes de signature qu'il accepte. 
 +Les parties en italique bleu ne concernent pas TLS1.2, le client supportant également TLS1.3. 
 +<html><pre class="code"> 
 +Transport Layer Security 
 +    TLSv1.2 Record Layer: Handshake Protocol: Client Hello 
 +        ... 
 +        Handshake Protocol: Client Hello 
 +            ... 
 +<span class="hly">            Cipher Suites (17 suites) 
 +                <b>Cipher Suite: TLS_AES_128_GCM_SHA256 (0x1301) 
 +                Cipher Suite: TLS_CHACHA20_POLY1305_SHA256 (0x1303) 
 +                Cipher Suite: TLS_AES_256_GCM_SHA384 (0x1302) 
 +                Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b)</b> 
 +                Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) 
 +                Cipher Suite: TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca9) 
 +                Cipher Suite: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca8) 
 +                Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02c) 
 +                Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) 
 +                Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a) 
 +                Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009) 
 +                Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) 
 +                Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) 
 +                Cipher Suite: TLS_RSA_WITH_AES_128_GCM_SHA256 (0x009c) 
 +                Cipher Suite: TLS_RSA_WITH_AES_256_GCM_SHA384 (0x009d) 
 +                Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA (0x002f) 
 +                Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA (0x0035)</span> 
 +            ... 
 +<span class="txtb">            Extension: key_share (len=1327) 
 +                Type: key_share (51) 
 +                Length: 1327 
 +                Key Share extension 
 +                    Client Key Share Length: 1325 
 +                    Key Share Entry: Group: Unknown (4588), Key Exchange length: 1216 
 +                        Group: Unknown (4588) 
 +                        Key Exchange Length: 1216 
 +                        Key Exchange: 8a8a4f6c01bacd7873cae7c51169be733813e0f4c6b4a45d23d8531f10a4eb6c8de97b1b… 
 +                    Key Share Entry: Group: x25519, Key Exchange length: 32 
 +                        Group: x25519 (29) 
 +                        Key Exchange Length: 32 
 +                        Key Exchange: c39ce197b6a7a135754f23d833a6b0863170cb3ca44ffa591bde4e1675c7ea52 
 +                    Key Share Entry: Group: secp256r1, Key Exchange length: 65 
 +                        Group: secp256r1 (23) 
 +                        Key Exchange Length: 65 
 +                        Key Exchange: 04eccfde6261d958052e6814a124b44da2717536a5d004b3daefaad7cd7b2cf7d75477de…</span> 
 +            ... 
 +<span class="hlg">            Extension: supported_versions (len=5) 
 +                Type: supported_versions (43) 
 +                Length: 5 
 +                Supported Versions length: 4 
 +                <b>Supported Version: TLS 1.3 (0x0304) 
 +                Supported Version: TLS 1.2 (0x0303)</b></span> 
 +<span class="hlo">            Extension: signature_algorithms (len=24) 
 +                Type: signature_algorithms (13) 
 +                Length: 24 
 +                Signature Hash Algorithms Length: 22 
 +                Signature Hash Algorithms (11 algorithms) 
 +                    Signature Algorithm: ecdsa_secp256r1_sha256 (0x0403) 
 +                    Signature Algorithm: ecdsa_secp384r1_sha384 (0x0503) 
 +                    Signature Algorithm: ecdsa_secp521r1_sha512 (0x0603) 
 +                    Signature Algorithm: rsa_pss_rsae_sha256 (0x0804) 
 +                    Signature Algorithm: rsa_pss_rsae_sha384 (0x0805) 
 +                    Signature Algorithm: rsa_pss_rsae_sha512 (0x0806) 
 +                    Signature Algorithm: rsa_pkcs1_sha256 (0x0401) 
 +                    Signature Algorithm: rsa_pkcs1_sha384 (0x0501) 
 +                    Signature Algorithm: rsa_pkcs1_sha512 (0x0601) 
 +                    Signature Algorithm: ecdsa_sha1 (0x0203) 
 +                    Signature Algorithm: rsa_pkcs1_sha1 (0x0201)</span> 
 +<span class="txtb">            Extension: psk_key_exchange_modes (len=2) 
 +                Type: psk_key_exchange_modes (45) 
 +                Length: 2 
 +                PSK Key Exchange Modes Length: 1 
 +                PSK Key Exchange Mode: PSK with (EC)DHE key establishment (psk_dhe_ke) (1)</span> 
 +... 
 +</pre></html> 
 +Le client annonce les suites cryptographiques qu'il sait manipuler, par ordre de préférence. En TLS1.2 seules la seconde et la quatrième sont compatibles. 
 +==== Server Hello ==== 
 +Le serveur choisit la suite cryptographique dans la liste proposée par le client, envoie son certificat et la clé publique de la parie publique/privée qu'il s'est construit, avec sa signature. 
 +<html><pre class="code"> 
 +Transport Layer Security 
 +    TLSv1.2 Record Layer: Handshake Protocol: Server Hello 
 +        Content Type: Handshake (22) 
 +        Version: TLS 1.2 (0x0303) 
 +        Length: 82 
 +        Handshake Protocol: Server Hello 
 +            Handshake Type: Server Hello (2) 
 +            Length: 78 
 +            <span class="bhly">Version: TLS 1.2 (0x0303)</span> 
 +            ... 
 +            <span class="bhly">Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b)</span> 
 +        ... 
 +<span class="hlg">    <b>TLSv1.2 Record Layer: Handshake Protocol: Certificate</b> 
 +        Content Type: Handshake (22) 
 +        Version: TLS 1.2 (0x0303) 
 +        Length: 2056 
 +        Handshake Protocol: Certificate 
 +        ... 
 +        ... 
 +        ... 
 +        ...</span> 
 +<span class="hlo">    TLSv1.2 Record Layer: Handshake Protocol: Server Key Exchange 
 +        Content Type: Handshake (22) 
 +        Version: TLS 1.2 (0x0303) 
 +        Length: 115 
 +        Handshake Protocol: Server Key Exchange 
 +            Handshake Type: Server Key Exchange (12) 
 +            Length: 111 
 +            EC Diffie-Hellman Server Params 
 +                Curve Type: named_curve (0x03) 
 +                Named Curve: x25519 (0x001d) 
 +                Pubkey Length: 32 
 +                <b>Pubkey: 6a3df53bdcd5d7983e01e960e73ab07fdac0566b0ecadca0f352be010f31f36d</b> 
 +                Signature Algorithm: ecdsa_secp256r1_sha256 (0x0403) 
 +                    Signature Hash Algorithm Hash: SHA256 (4) 
 +                    Signature Hash Algorithm Signature: ECDSA (3) 
 +                Signature Length: 71 
 +                <b>Signature: 3045022072c1e31f76f4126b2c31ad97271ba43932ae163795e8fc05bc111b4445266389…</b></span> 
 +    TLSv1.2 Record Layer: Handshake Protocol: Server Hello Done 
 +        Content Type: Handshake (22) 
 +        Version: TLS 1.2 (0x0303) 
 +        Length: 4 
 +        Handshake Protocol: Server Hello Done 
 +            Handshake Type: Server Hello Done (14) 
 +            Length: 0 
 +</pre></html> 
 +Pour la suite de la capture, une astuce permet à **firefox** de sauvegarder les clés de session et de les transmettre à **wireshark**, ce qui permet de décoder les échanges 8-) 
 +==== Client Key Exchange ==== 
 +Le client envoie sa clé publique au serveur et conclue. 
 +<html><pre class="code"> 
 +Transport Layer Security 
 +    TLSv1.2 Record Layer: Handshake Protocol: Client Key Exchange 
 +        ... 
 +        Handshake Protocol: Client Key Exchange 
 +            EC Diffie-Hellman Client Params 
 +                Pubkey Length: 32 
 +<span class="bhly">                Pubkey: fca8d0c4230e51ee9628d81f7eff1df36016cafdb5dc9e6a116c862191a2fb22</span> 
 +    ... 
 +    TLSv1.2 Record Layer: Handshake Protocol: Finished 
 +</pre></html>
  
-[[https://www.rfc-editor.org/info/rfc7905/|RFC 7905: ChaCha20-Poly1305 Cipher Suites for Transport Layer Security (TLS)]] 
  
-^ TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 ^^ 
-| Protocole        | Transport Layer Security (TLS1.2 et TLS1.3) | 
-| Échange de clés  | Elliptic Curve Diffie-Hellman Ephemeral (ECDHE) | 
-| Authentification | Elliptic Curve Digital Signature Algorithm (ECDSA) | 
-| Chiffrement      | ChaCha stream cipher and Poly1305 authenticator (CHACHA20 POLY1305) | 
-| Hachage          | Secure Hash Algorithm 256 (SHA256) | 
  
  
-^ TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 ^^ 
-| Protocole        | Transport Layer Security (TLS1.2 et TLS1.3) | 
-| Échange de clés  | Elliptic Curve Diffie-Hellman Ephemeral (ECDHE) | 
-| Authentification | Elliptic Curve Digital Signature Algorithm (ECDSA) | 
-| Chiffrement      | Advanced Encryption Standard with 128bit key in Galois/Counter mode (AES 128 GCM)  | 
-| Hachage          | Secure Hash Algorithm 256 (SHA256) | 
- 
-[[https://www.rfc-editor.org/info/rfc8446/|RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3]] 
- 
-^ TLS_AES_256_GCM_SHA384 ^^ 
-| Protocole        | Transport Layer Security (TLS1.3) | 
-| Chiffrement      | Advanced Encryption Standard with 256bit key in Galois/Counter mode (AES 256 GCM) | 
-| Hachage          | Secure Hash Algorithm 384 (SHA384) | 
- 
-^ TLS_AES_128_GCM_SHA256 ^^ 
-| Protocole        | Transport Layer Security (TLS1.3) | 
-| Chiffrement      | Advanced Encryption Standard with 128bit key in Galois/Counter mode (AES 128 GCM) | 
-| Hachage          | Secure Hash Algorithm 256 (SHA384) | 
-Parmi les protocoles considérés comme faibles: 
-^  TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384 ^^ 
-| Protocole        | Transport Layer Security (TLS1.2 et 1.3) | 
-| Échange de clés  | Diffie-Hellman (DH) | 
-| Authentification | Digital Signature Standard (DSS) | 
-| Chiffrement      | CAMELLIA with 256bit key in Galois/Counter mode (CAMELLIA 256 GCM) | 
-| Hachage          | Secure Hash Algorithm 384 (SHA384) | 
- 
-===== Les différents algorithmes ===== 
-Dans les suites utilisables par TLS1.2, nous trouvons les besoins suivants: 
-  - Un échange de clés, la ou les clés de session pour le chiffrement symétrique, 
-  - une authentification, 
-  - le chiffrement proprement dit, 
-  - le hachage. 
-Pour ce qui est des suites utilisables seulement par TLS 1.3, les opérations sont plus condensées, ce que nous allons voir par la suite. 
TLS1.2: Dernière modification le: 14/06/2026 à 14:31 par prof