Sie sind auf Seite 1von 40

Cryptographie

Khaled SAMMOUD
Principe
 Le chiffrement protége informations et transmissions des personnes non
autorisées.

 Des systèmes de chiffrements sont disponibles pour ordinateurs (stockage de


fichiers) et pour les transmissions.

 L'algorithme de chiffrement transforme le texte en clair en texte chiffré à l'aide


d'une clé.

Source Cryptogramme Récepteur


CLAIR CLAIR
Implémentation

 Le chiffrement peut être installé dans plusieurs couches du modèle


OSI :

Application Application
Présentation Présentation
Session Session
Transport Transport
Réseau Réseau Réseau
Liaison Liaison Liaison Liaison
Physique Physique Physique Physique
Implémentation

 Le chiffrement peut être installé dans plusieurs couches du modèle


OSI :

Application Application
Présentation Présentation
Session Session
Transport Transport
Réseau Réseau Réseau
Liaison Liaison Liaison Liaison
Physique Physique Physique Physique
Implémentation

 Le chiffrement peut être installé dans plusieurs couches du modèle


OSI :

Application Application
Présentation Présentation
Session Session
Transport Transport
Réseau Réseau Réseau
Liaison Liaison Liaison Liaison
Physique Physique Physique Physique
Implémentation

 Le chiffrement peut être installé dans plusieurs couches du modèle


OSI :

Application Application
Présentation Présentation
Session Session
Transport Transport
Réseau Réseau Réseau
Liaison Liaison Liaison Liaison
Physique Physique Physique Physique
Implémentation

 Le chiffrement peut être installé dans plusieurs couches du modèle


OSI :

Application Application
Présentation Présentation
Session Session
Transport Transport
Réseau Réseau Réseau
Liaison Liaison Liaison Liaison
Physique Physique Physique Physique
Implémentation

 Le chiffrement peut être installé dans plusieurs couches du modèle


OSI :

Application Application
Présentation Présentation
Session Session
Transport Transport
Réseau Réseau Réseau
Liaison Liaison Liaison Liaison
Physique Physique Physique Physique
Services de sécurité
 La confidentialité : garantir que les données ne puisse être
compréhensibles par une entité tierce non autorisée.

 L'authentification : permettre l'authentifier les entités qui communiquent


entre elles et garantir l'identité des correspondants.

 L'intégrité : détection des altérations entre émetteur et récepteur.

 La non répudiation : permet de garantir l'identité de l'émetteur, il est le


seul à en porter éventuellement la responsabilité.

Non répudiation
Authentification
Intégrité
Notions fondamentales
 La cryptographie : ensemble des moyens permettant de transformer
un texte original en un texte incompréhensible.

 Chiffrer, déchiffrer : transformation du texte clair en texte chiffré.


L'opération inverse est le déchiffrement.

 Décryptage : consiste à retrouver un texte clair sans en connaître la


clé.

 La cryptanalyse : ensemble des techniques permettant le


décryptage.

 La stéganographie : consiste à dissimuler un texte clair dans un


ensemble de données anodines.
Taux Tu as un xelephone
Techniques cryptographiques
 Les principales techniques de cryptographie se répartissent en deux
catégories :
 Les systèmes symétriques : les clés nécessaires au chiffrement et
déchiffrement sont identiques et connues seulement de l'émetteur et
du récepteur (clés secrètes). Ces systèmes mettent en œuvre des
techniques de transposition ou de substitution.
 Algorithme de César
 DES (Data Enryption Standard)
 Les systèmes asymétriques ou algorithme à clé double, chaque
utilisateur dispose d'une clé publique et d'une clé secrète. Le message
à chiffrer est fait avec la clé publique et déchiffré à l'aide de la clé
secrète.
 RSA (Rivest, Shamir, Adleman)
Systèmes symétriques
 Principe :
 Choix d'un algorithme de chiffrement à clé secrète
 Choix d'une clé
 Chiffrement
 Transmission
 Déchiffrement

 Les algorithmes étant souvent connus, le choix de la clé (et la


distribution) reste l'élément faible de la chaîne.

 Si une clé différente est utilisée pour chaque paire d'utilisateur du


réseau le nombre total de clés croît très vite.
Systèmes asymétriques
 Principe :
 Choix d'un algorithme de chiffrement à clé publique
 Chiffrement à l'aide d'une clé publique
 Transmission
 Déchiffrement avec la clé privée

 La clé publique peut être obtenue par transmission préalable ou par


accès dans une BD.

 La cryptographie à clé publique résout le problème des systèmes à


clé secrète : la distribution des clés.
Systèmes hybrides
 Les algorithmes à clé publique sont significativement plus lents que
les algorithmes à clé secrète (103).

Crypto-système hybride

Système à clé
secrète
Système à clé
publique
Exemples simples
Le code de César

 C'est un algorithme à translation ou substitution ou à décalage mod 26

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
C C F
E E H
S S V
A A D
R R U

Texte clair = CESAR


Clé  k=3 Cryptogramme = FHVDU
Exemples simples
Le chiffrement affine

 C'est un algorithme à décalage mod 26 de la forme e(x) = ax + b


(pour a = 1 on retrouve le code de César).

 Pour que l'opération de déchiffrement soit réalisable il est


nécessaire que la fonction soit injective.
Pour tout y de e(x), l'équation ax + b doit avoir une solution unique
Soit la fonction e(x) = 4x + b

Il faut que le PGDC du cardinal de l'alphabet et "a" = 1


Exemples simples
La transposition
 Méthode de pliage Texte clair = UNE PLANCHE A VOILE
Clé  k = SURF

S U R F
3 4 2 1
U N E P
L A NC
H E A V
O I L E

Cryptogramme = PCVEENALULHONAEI
Exemples simples
Le code de Vigenère
 C'est un algorithme à substitution mod 26

Texte clair = UNE PLANCHE A VOILE


Clé  k = SURF

Clair  U N E P L A N C H E A V O I L E
Clé  S U R F S U R F S U R F S U R F
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
2 B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
3 C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
4 D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
5 E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
6 F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
7 G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
8 H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
10 I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
11 J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
12 K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
13 L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
14 M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
15 N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
16 O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
17 P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
18 Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
19 R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
20 S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
21 T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
22 U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
2 B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
3 C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
4 D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
5 E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
6 F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
7 G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
8 H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
10 I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
11 J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
12 K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
13 L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
14 M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
15 N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
16 O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
17 P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
18 Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
19 R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
20 S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
21 T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
22 U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
2 B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
3 C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
4 D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
5 E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
6 F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
7 G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
8 H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
10 I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
11 J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
12 K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
13 L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
14 M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
15 N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
16 O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
17 P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
18 Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
19 R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
20 S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
21 T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
22 U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
2 B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
3 C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
4 D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
5 E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
6 F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
7 G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
8 H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
10 I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
11 J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
12 K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
13 L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
14 M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
15 N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
16 O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
17 P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
18 Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
19 R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
20 S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
21 T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
22 U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
Exemples simples
Le code de Vigenère
 C'est un algorithme à substitution mod 26

Texte clair = UNE PLANCHE A VOILE


Clé  k = SURF

Clair  U N E P L A N C H E A V O I L E
Clé  S U R F S U R F S U R F S U R F
Crypto  M H V U D U E H Z Y R A G C C J
Solutions diverses
 DES (Data Encryption Standard) algorithme de chiffrement à clé
symétrique. Développé par IBM et adopté comme standard officiel,
le DES utilise une clé de 56 bits.

 IDEA (International Data Encryption Algorithm) algorithme de


chiffrement à clé symétrique. Développé en Suisse, les droits
d'exploitation sont détenus par Ascom Systec AG.

 HTTPS extension du protocole HTTP, et basé sur le protocole SSL,


permettant de négocier dynamiquement un algorithme de
chiffrement.

 RC2 et RC4 (Rivest's Code) algorithme de chiffrement à clé


symétrique propriétaire RSA Data Security.
Solutions diverses
 RSA (Rivest – Shamir - Adleman) du nom des trois inventeurs de cet
algorithme à clé publique (ou à clé asymétrique).

 SSL, STT, SET, SSH, il s'agit de protocoles permettant de négocier


interactivement des algorithme de chiffrement. C'est bien souvent
RC4 (40 bits pour l'exportation) qui est choisi pour Netscape. Ce
sont des algorithme à clé symétrique.
 SSL : Secure Socket Layer proposé par Netscape©

 STT : Secure Transaction Technology proposé par Microsoft©

 SET : Secure Electronic Transaction proposé par Visa-


Mastercard©
 SSH : Secure SHell
RSA
Le système RSA
 Cette méthode date de1977 et a été inventée par les
mathématiciens Ronald Rivest, Adi Shamir et Léonard Adleman.

 C'est une méthode de chiffrement asymétrique.

 Cette méthode de chiffrement est simple à appliquer et reste


relativement sûre, du moins dans le cadre des connaissances
mathématiques actuelles.

 Le niveau de sécurité de RSA dépend de la difficulté de factoriser


des grands nombres.

 Les clé publiques et privées sont des fonctions d'une paire de


grands nombres premiers (100 à 200 chiffres ou plus).
RSA
Le système RSA
 Théorème de Fermat (XVIIe siècle) :

Soit p = nombre premier alors :


710 mod 11 = 1
m (p-1) mod p = 1

 Autre relation mise en évidence par Leonhard Euler :

Soit p & q = deux nombres premiers et n = p x q alors :

m (p-1) (q-1) mod n = 1


Soit p = 11, q = 5 et m = 38  38 40
mod 55 = 1
RSA
Le système RSA : clé publique
 Il faut choisir un produit n de deux nombres premiers p et q :
 p = 29
 q = 37
 n = 29 x 37 = 1073

 Il faut choisir un entier E tel que E soit premier avec (p-1)(q-1).


 Exemple E = 5 (5 et (28 x 36) premiers entre eux)

 Diffusion de la clé publique : RSA, n, E

RSA,
RSA,1073,
1073,55
RSA
Le système RSA : clé publique
 Sur le plan pratique, les experts recommandent d'utiliser des
nombres de :
 768 bits (232 chiffres) dans le cas de données peu confidentielles
 1024 bits (309 chiffres) pour un usage commercial
 2048 bits (617 chiffres) pour une très grande garantie de sécurité

 Les clés de 512 bits (155 chiffres décimaux), bien que très utilisées
ne devrait plus l'être (août 99 = factorisation de nombres de cette
taille).

 Doubler la longueur "l" des clés revient à :


 Multiplier par 16 le temps de création des clés (l4)
 Multiplier par 4 le temps de chiffrement, déchiffrement (l2)
RSA
Le système RSA : clé publique
 En 1970, on savait factoriser des nombres entiers de 20 chiffres
(64.bits).

 En 1980, le record était de 50 chiffres (164.bits).

 En 1990, le record était de 116 chiffres (384.bits).

 En 1994, le record était de 129 chiffres : RSA-129.

 En 1996, RSA-130.

 En 1999, RSA-140 et RSA-155 (512 bits).


RSA
Le système RSA : clé publique
Résultat du record de factorisation du RSA-155 :
155 chiffres factorisés en 2 nombres premiers de 78 chiffres
300 ordinateurs et ……… 3,5 mois de calcul.
10941 73864 15705 27421 80970 73220 40357 61200 37329 45449
20599 09138 42131 47634 99842 88934 78471 79972 57891 26733
24976 25752 89978 18337 97076 53724 40271 46743 53159 33543
33897
=
102 63959 28297 41105 77205 41965 73991 67590 07165 67808
03806 68033 41933 52179 07113 07779
x
106 60348 83801 68454 82092 72203 60012 87867 92079 58575
98929 15222 70608 23719 30628 08643
RSA
Le système RSA : chiffrement

RSA,
RSA,1073,
1073,55

 Pour coder un message il faut le convertir en chiffres M / M < n.

 L'opération de codage consiste à trouver C / C = ME mod n

 Soit le message "AU TABLEAU" à coder :


 Le message devient "01 21 20 01 02 12 05 01 21"
 Conversion "012 120 010 212 050 121"
 Après codage on obtient : 969
969589
589211
211788
788553
553544
544
RSA
Le système RSA : clé de déchiffrage

969
969589
589211
211788
788553
553544
544

 Il faut générer la clé de déchiffrage D. Elle est donnée par la formule


DE = 1 mod [(p-1)(q-1)].

 Exemple :
 p = 29 et q = 37
E=5
 (p-1)(q-1) = 28 x 36 = 1008
 DE = 1 mod 1008 DD==605
605
RSA
Le système RSA : déchiffrage

969
969589
589211
211788
788553
553544
544

DD==605
605

 L'opération de déchiffrage consiste à effectuer M = CD mod n

 Exemple : 969605 mod 1073 = 012

012
012120
120010
010212
212050
050121
121
RSA
Le système RSA

RSA,
RSA,15,
15,33

Clair 02 09 03
Crypto 08 09 12

pp==3,
3,qq==55

Clair 04 07 08
Crypto 04 13 02
Le système DES
 Le DES a été proposé à l'origine par IBM, approuvé par le NIST (National Institute of
Standards and Technology), adopté par le gouvernement des Etats-Unis (déchiffrable
par la NSA (National Security Agency)).

 Il est basé sur un travail d'IBM et est devenu le standard X3.92-1981/R1987.

 Le DES consiste en 16 opérations qui mélange les données et la clé de façon à ce que
chaque bit du texte chiffré dépende de chaque bit du texte original et de chaque bit de
la clé.

 Le principe le plus couramment utilisé consiste à découper un message M (suite


binaire codée dans un alphabet quelconque) en un ensemble de blocs U de 64 bits.

 Chacun d'eux sera codé, à l'émission, et décodé, à la réception indépendamment des


autres blocs avec une clé K, de 56 bits.

 La clé K va permettre de générer 16 clés intermédiaires, chacune servant pour une


itération.

 L'algorithme fonctionne sur le principe de permutations, substitutions, et d'additions


modulo 2.
DES
Algorithme DES
Message

Permutation Bloc de 64 bits


K
Itération 1
32 bits Gi 32 bits Di 32 bits f(Ki, Di)

Itération i +
32 bits Gi+1 32 bits Di+1
Itération 16

Permutation Bloc chiffré de 64 bits


DES
Le futur : AES (Advanced Encryption Standard)

 Au terme d'une compétition internationale qui à duré trois ans, le


NIST (National Institute of Standards and Technology) a choisi le
lundi 2 octobre 2000, un algorithme de cryptage belge, baptisé
Rijndael, pour succéder au système DES.

 Rijndael est l'œuvre de deux cryptographes flamands, Joan Daemen


et Vincent Rijmen.

 En avril 2000, seul 5 produits restaient en lice, 3 systèmes


américains (proposés par IBM, RSA Security et Counterpaneq) et
deux produits européens.
DES
Conclusions
 RSA est utilisé par un grand nombre de produits logiciels ou
matériels de par le monde.

 Microsoft, IBM, Apple, Sun, Digital, Novell, …. implémentent RSA


dans leurs systèmes d'exploitation.

 Beaucoup de services gouvernementaux l'utilisent ainsi que de


grandes compagnies comme Boeing, Shell Oil,…. et des instituts de
recherche comme Bellcore, NSF.

 RSA est plus lent que DES. C'est dû aux algorithmes plus simples et
aux clés plus courtes. L'implémentation logicielle du DES procure un
gain de 100 et l'implémentation matérielle un gain 1 000 à 10 000.

 RSA est la solution pour la gestion des clés.


PGP
Pretty Good Privacy

 PGP à été créé en 1992 par un programmeur américain, passionné de


cryptographie, Philip Zimmermann. PGP à connu un rapide succès lié à
la saga de son inventeur.

 Afin de préserver la confidentialité d'une information, il créé PGP 1.0


qu'il diffuse sur le Net. Ce programme passe les frontières et devient le
programme fétiche des "cypherpunks".

 PGP est un cryptosystème hybride qui utilise un chiffrement de session


IDEA (chiffrement par bloc), l'algorithme RSA pour la gestion des clés.

 Un des aspects intéressant de PGP est son approche de la gestion des


clés : tous les utilisateurs engendrent et distribuent leur propre clé
publique.

Das könnte Ihnen auch gefallen