Démonstration RSA

Génération du bi-clé
  1. Choix de deux premiers : p = 821 & q = 823 => pgcd(821,823) = 1
  2. Calcul du module : n = p x q = 821 x 823 = 675683
  3. Indicatrice d'Euler : φ(n) = (p - 1) x (q - 1) = 674040
  4. Exposant chiffrement : e = 7 => pgcd(e,φ(n)) = 1
  5. Exposant déchiffrement : d x e = 1 mod φ(n) & d < φ(n)
    192583 x 7 = 1348080 + 1 => d = 192583
  6. Clé publique : KPub = { 000007, 675683 }
  7. Clé privée : KPrv = { 192583, 675683 }
Exemple d'utilisation
  1. Algorithme : Enc = Dec7 mod 675683 <=> Dec = Enc192583 mod 675683
  2. Message secret : texte clair = Cédric Clément (taille = 24 octets en UTF-8)
  3. Représentation : hexadécimale = 43:26:23:32:33:33:3b:64:72:69:63:20:43:6c:26:23:32:33:33:3b:6d:65:6e:74
  4. Chiffrement : cryptogramme = 9bada:25641:14fac:4cef9:42fb0:42fb0:2cdff:730af:75cde:16ce2:1cedb:8e1f7:9bada:2f482:25641:14fac:4cef9:42fb0:42fb0:2cdff:193aa:d935:4d36c:6138a
  5. Déchiffrement : texte clair = Cédric Clément
Cassage par force brute
  1. Méthode #1 via racine : p < √n & n mod p = 0
  2. Méthode #2 via Fermat : x² - y² = (x + y)(x - y)
  3. Factorisation module 1 : p = 823 & q = 821
  4. Factorisation module 2 : p = 823 & q = 821
  5. Obtention clé publique : KPub = { 000007, 675683 }
  6. Déduction clé privée 1 : KPrv = { 192583, 675683 }
  7. Déduction clé privée 2 : KPrv = { 192583, 675683 }
  8. Temps crackage racine : 0.000017 secondes
  9. Temps crackage Fermat : 0.000013 secondes
Article Wikipedia