{"id":119,"date":"2012-04-14T14:56:14","date_gmt":"2012-04-14T13:56:14","guid":{"rendered":"http:\/\/www.unicoda.com\/?p=119"},"modified":"2012-11-19T15:31:32","modified_gmt":"2012-11-19T14:31:32","slug":"cryptographie-rsa","status":"publish","type":"post","link":"https:\/\/www.unicoda.com\/?p=119","title":{"rendered":"Cryptographie RSA"},"content":{"rendered":"<p><strong>Chiffrement RSA<\/strong><\/p>\n<p><span style=\"text-decoration: underline;\">Principe\u00a0:<\/span><\/p>\n<p>Si Bob d\u00e9sire que l&rsquo;on puisse communiquer avec lui de fa\u00e7on secr\u00e8te, il proc\u00e8de de la mani\u00e8re suivante\u00a0:<\/p>\n<ol>\n<li>Bob engendre deux grands nombres premiers p et q (test de primalit\u00e9).<\/li>\n<li>Bob calcule n = p q donc <span style=\"font-family: Times New Roman,serif;\">\u0278<\/span><span style=\"font-family: Times New Roman,serif;\">(n) = (p-1)(q-1), <\/span><span style=\"font-family: Times New Roman,serif;\">\u0278 indicateur d&rsquo;Euler.<\/span><\/li>\n<li><span style=\"font-family: Times New Roman,serif;\">Bob choisit un nombre al\u00e9atoire b avec 1<\/span><span style=\"font-family: Times New Roman,serif;\">\u2264<\/span><span style=\"font-family: Times New Roman,serif;\"> b <\/span><span style=\"font-family: Times New Roman,serif;\">\u2264<\/span><span style=\"font-family: Times New Roman,serif;\"> \u0278(n) tel que pgcd(b, \u0278(n) ) = 1.<\/span><\/li>\n<li><span style=\"font-family: Times New Roman,serif;\">Bob calcule l&rsquo;inverse de p modulo \u0278(n), not\u00e9 e, c&rsquo;est-\u00e0-dire\u00a0: b*e \u2261 1 mod \u0278(n) (Algorithme d&rsquo;Euclide g\u00e9n\u00e9ralis\u00e9).<\/span><\/li>\n<li><span style=\"font-family: Times New Roman,serif;\">Bob publie (n, b) (clef public) et garde e qui forme la clef secr\u00e8te.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-family: Times New Roman,serif;\">Fantasio veut envoyer un message M (M &lt; n) \u00e0 Bob, il calcule\u00a0:<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">C = M^b mod n et envoi C \u00e0 Bob.<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">Bob re\u00e7oit C et calcule\u00a0: C^e mod n =M<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Times New Roman,serif;\"><span style=\"text-decoration: underline;\"><strong>Notions math\u00e9matiques\u00a0:<\/strong><\/span><\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">Consid\u00e9rons l&rsquo;ensemble suivant\u00a0: En = {0, 1, 2, \u2026, n-1}.<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\"><span style=\"text-decoration: underline;\">Th\u00e9or\u00e8me\u00a0:<\/span><\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">Soit a appartient \u00e0 En, alors a est inversible ssi pgcd(a,n) = 1, c&rsquo;est-\u00e0-dire, a et n sont premiers entre eux. Ainsi, si n est premier, alors chaque \u00e9l\u00e9ment de En est inversible, sauf 0\u00a0.<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\"><span style=\"text-decoration: underline;\">D\u00e9finition :<\/span> <\/span><span style=\"font-family: Times New Roman,serif;\">Indicateur d&rsquo;Euler not\u00e9 \u0278.<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\">Il indique le nombre d&rsquo;\u00e9l\u00e9ment inversible de En.<\/span><\/p>\n<p><span style=\"font-family: Times New Roman,serif;\"><span style=\"text-decoration: underline;\">Propri\u00e9t\u00e9s de \u0278(n)\u00a0:<\/span><\/span><\/p>\n<ol>\n<li><span style=\"font-family: Times New Roman,serif;\">\u00a0Si n est premier, alors \u0278(n) = n-1.<\/span><\/li>\n<li><span style=\"font-family: Times New Roman,serif;\">Si m et n sont premiers entre eux, \u0278(m*n) = \u0278(m)* \u0278(n).<\/span><\/li>\n<li><span style=\"font-family: Times New Roman,serif;\">Si m et n sont premiers, alors \u0278(m*n) = (m-1)*(n-1).<\/span><\/li>\n<li><span style=\"font-family: Times New Roman,serif;\">Si a est inversible de En, alors a^ \u0278(n) <\/span><span style=\"font-family: Times New Roman,serif;\">\u2261<\/span><span style=\"font-family: Times New Roman,serif;\"> 1 mod n.<\/span><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Chiffrement RSA Principe\u00a0: Si Bob d\u00e9sire que l&rsquo;on puisse communiquer avec lui de fa\u00e7on secr\u00e8te, il proc\u00e8de de la mani\u00e8re suivante\u00a0: Bob engendre deux grands nombres premiers p et q (test de primalit\u00e9). Bob calcule n = p q donc \u0278(n) = (p-1)(q-1), \u0278 indicateur d&rsquo;Euler. Bob choisit un nombre al\u00e9atoire b avec 1\u2264 b &hellip; <a href=\"https:\/\/www.unicoda.com\/?p=119\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Cryptographie RSA&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[46,47],"class_list":["post-119","post","type-post","status-publish","format-standard","hentry","category-info","tag-cryptographie","tag-rsa"],"_links":{"self":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=119"}],"version-history":[{"count":5,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":900,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions\/900"}],"wp:attachment":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}