\( %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Mes commandes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\multirows}[3]{\multirow{#1}{#2}{$#3$}}%pour rester en mode math \renewcommand{\arraystretch}{1.3}%pour augmenter la taille des case \newcommand{\point}[1]{\marginnote{\small\vspace*{-1em} #1}}%pour indiquer les points ou le temps \newcommand{\dpl}[1]{\displaystyle{#1}}%megamode \newcommand{\A}{\mathscr{A}} \newcommand{\LN}{\mathscr{N}} \newcommand{\LL}{\mathscr{L}} \newcommand{\K}{\mathbb{K}} \newcommand{\N}{\mathbb{N}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\R}{\mathbb{R}} \newcommand{\C}{\mathbb{C}} \newcommand{\M}{\mathcal{M}} \newcommand{\D}{\mathbb{D}} \newcommand{\E}{\mathcal{E}} \renewcommand{\P}{\mathcal{P}} \newcommand{\G}{\mathcal{G}} \newcommand{\Kk}{\mathcal{K}} \newcommand{\Cc}{\mathcal{C}} \newcommand{\Zz}{\mathcal{Z}} \newcommand{\Ss}{\mathcal{S}} \newcommand{\B}{\mathbb{B}} \newcommand{\inde}{\bot\!\!\!\bot} \newcommand{\Proba}{\mathbb{P}} \newcommand{\Esp}[1]{\dpl{\mathbb{E}\left(#1\right)}} \newcommand{\Var}[1]{\dpl{\mathbb{V}\left(#1\right)}} \newcommand{\Cov}[1]{\dpl{Cov\left(#1\right)}} \newcommand{\base}{\mathcal{B}} \newcommand{\Som}{\textbf{Som}} \newcommand{\Chain}{\textbf{Chain}} \newcommand{\Ar}{\textbf{Ar}} \newcommand{\Arc}{\textbf{Arc}} \newcommand{\Min}{\text{Min}} \newcommand{\Max}{\text{Max}} \newcommand{\Ker}{\text{Ker}} \renewcommand{\Im}{\text{Im}} \newcommand{\Sup}{\text{Sup}} \newcommand{\Inf}{\text{Inf}} \renewcommand{\det}{\texttt{det}} \newcommand{\GL}{\text{GL}} \newcommand{\crossmark}{\text{\ding{55}}} \renewcommand{\checkmark}{\text{\ding{51}}} \newcommand{\Card}{\sharp} \newcommand{\Surligne}[2]{\text{\colorbox{#1}{ #2 }}} \newcommand{\SurligneMM}[2]{\text{\colorbox{#1}{ #2 }}} \newcommand{\norm}[1]{\left\lVert#1\right\rVert} \renewcommand{\lim}[1]{\underset{#1}{lim}\,} \newcommand{\nonor}[1]{\left|#1\right|} \newcommand{\Un}{1\!\!1} \newcommand{\sepon}{\setlength{\columnseprule}{0.5pt}} \newcommand{\sepoff}{\setlength{\columnseprule}{0pt}} \newcommand{\flux}{Flux} \newcommand{\Cpp}{\texttt{C++\ }} \newcommand{\Python}{\texttt{Python\ }} %\newcommand{\comb}[2]{\begin{pmatrix} #1\\ #2\end{pmatrix}} \newcommand{\comb}[2]{C_{#1}^{#2}} \newcommand{\arrang}[2]{A_{#1}^{#2}} \newcommand{\supp}[1]{Supp\left(#1\right)} \newcommand{\BB}{\mathcal{B}} \newcommand{\arc}[1]{\overset{\rotatebox{90}{)}}{#1}} \newcommand{\modpi}{\equiv_{2\pi}} \renewcommand{\Re}{Re} \renewcommand{\Im}{Im} \renewcommand{\bar}[1]{\overline{#1}} \newcommand{\mat}{\mathcal{M}} \newcommand{\und}[1]{{\mathbf{\color{red}\underline{#1}}}} \newcommand{\rdots}{\text{\reflectbox{$\ddots$}}} \newcommand{\Compa}{Compa} \newcommand{\dint}{\dpl{\int}} \newcommand{\intEFF}[2]{\left[\!\left[#1 ; #2\right]\!\right]} \newcommand{\intEFO}[2]{\left[\!\left[#1 ; #2\right[\!\right[} \newcommand{\intEOF}[2]{\left]\!\left]#1 ; #2\right]\!\right]} \newcommand{\intEOO}[2]{\left]\!\left]#1 ; #2\right[\!\right[} \newcommand{\ou}{\vee} \newcommand{\et}{\wedge} \newcommand{\non}{\neg} \newcommand{\implique}{\Rightarrow} \newcommand{\equivalent}{\Leftrightarrow} \newcommand{\Ab}{\overline{A}} \newcommand{\Bb}{\overline{B}} \newcommand{\Cb}{\overline{C}} \newcommand{\Cl}{\texttt{Cl}} \newcommand{\ab}{\overline{a}} \newcommand{\bb}{\overline{b}} \newcommand{\cb}{\overline{c}} \newcommand{\Rel}{\mathcal{R}} \newcommand{\superepsilon}{\varepsilon\!\!\varepsilon} \newcommand{\supere}{e\!\!e} \makeatletter \newenvironment{console}{\noindent\color{white}\begin{lrbox}{\@tempboxa}\begin{minipage}{\columnwidth} \ttfamily \bfseries\vspace*{0.5cm}} {\vspace*{0.5cm}\end{minipage}\end{lrbox}\colorbox{black}{\usebox{\@tempboxa}} } \makeatother \def\ie{\textit{i.e. }} \def\cf{\textit{c.f. }} \def\vide{ { $ {\text{ }} $ } } %Commande pour les vecteurs \newcommand{\grad}{\overrightarrow{Grad}} \newcommand{\Vv}{\overrightarrow{v}} \newcommand{\Vu}{\overrightarrow{u}} \newcommand{\Vw}{\overrightarrow{w}} \newcommand{\Vup}{\overrightarrow{u'}} \newcommand{\Zero}{\overrightarrow{0}} \newcommand{\Vx}{\overrightarrow{x}} \newcommand{\Vy}{\overrightarrow{y}} \newcommand{\Vz}{\overrightarrow{z}} \newcommand{\Vt}{\overrightarrow{t}} \newcommand{\Va}{\overrightarrow{a}} \newcommand{\Vb}{\overrightarrow{b}} \newcommand{\Vc}{\overrightarrow{c}} \newcommand{\Vd}{\overrightarrow{d}} \newcommand{\Ve}[1]{\overrightarrow{e_{#1}}} \newcommand{\Vf}[1]{\overrightarrow{f_{#1}}} \newcommand{\Vn}{\overrightarrow{0}} \newcommand{\Mat}{Mat} \newcommand{\Pass}{Pass} \newcommand{\mkF}{\mathfrak{F}} \renewcommand{\sp}{Sp} \newcommand{\Co}{Co} \newcommand{\vect}[1]{\texttt{Vect}\dpl{\left( #1\right)}} \newcommand{\prodscal}[2]{\dpl{\left\langle #1\left|\vphantom{#1 #2}\right. #2\right\rangle}} \newcommand{\trans}[1]{{\vphantom{#1}}^{t}{#1}} \newcommand{\ortho}[1]{{#1}^{\bot}} \newcommand{\oplusbot}{\overset{\bot}{\oplus}} \SelectTips{cm}{12}%Change le bout des flèches dans un xymatrix \newcommand{\pourDES}[8]{ \begin{itemize} \item Pour la ligne : le premier et dernier caractère forment $#1#2$ soit $#4$ en base 10. \item Pour la colonne : les autres caractères du bloc forment $#3$ soit $#5$ en base 10. \item A l'intersection de la ligne $#4+1$ et de la colonne $#5+1$ de $S_{#8}$ se trouve l'entier $#6$ qui, codé sur $4$ bits, est \textbf{\texttt{$#7$}}. \end{itemize} } \)
Exercice

L'exercice suivant est automatiquement et aléatoirement généré par ataraXy.
Si vous regénérez la page (F5) les valeurs seront changées.
La correction se trouve en bas de page.


Exercice


On considère dans le système RSA, la clef publique \( (899, 521)\) .
  1. Déterminer deux entiers \( p\) et \( q\) tel que \( p {<} q\) et \( 899=pq\) .
  2. Justifier que \( (899, 521)\) est une clef publique valide du cryptosystème RSA.
    1. Déterminer la décomposition de \( 521\) en binaire.
    2. Calculer \( 83^{521}\) modulo \( 899\) .
    3. Quel est le message chiffré de \( M=83\) .
  3. Déterminer la clef privé associée à la clef publique \( (899, 521)\) .
  4. Déchiffrer le message \( M'=259\)
Cliquer ici pour afficher la solution

Exercice


  1. On observe que \( 899=29\times 31\) .
  2. Pour vérifier que \( (899, 521)\) est une clef publique valide du cryptosystème RSA, il faut d'une part que \( 899\) soit le produit de deux nombres premiers, ce que nous avons vérifier à la question précédente. Il faut d'autre part que \( 521\) soit inversible modulo \( \phi=(p-1)(q-1)=28\times30=840\) . Ce qui se vérifie avec l'algorithme d'Euclide : \[\begin{array}{|c|c|c|c||c|c|}\hline a&b&r&q&u&v \\ \hline 840 & 521 & 319 & 1&49 & -79 \\ \hline 521 & 319 & 202 & 1&-30 & 49 \\ \hline 319 & 202 & 117 & 1&19 & -30 \\ \hline 202 & 117 & 85 & 1&-11 & 19 \\ \hline 117 & 85 & 32 & 1&8 & -11 \\ \hline 85 & 32 & 21 & 2&-3 & 8 \\ \hline 32 & 21 & 11 & 1&2 & -3 \\ \hline 21 & 11 & 10 & 1&-1 & 2 \\ \hline 11 & 10 & 1 & 1&1 & -1 \\ \hline 10 & 1 & 0 & 10&0 & 1 \\ \hline \end{array}\]
    1. Le nombre \( 521\) en binaire s'écrit \( 1000001001\) .
    2. On appliquel'algorithme d'exponentiation modulaire : \[ \begin{array}{r|*{10}{|c}} k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\\hline83^{2^k} & 83 & 6889 & 355216 & 12321 & 401956 & 10609 & 518400 & 331776 & 2025 & 51529\\mod\ 899 & \fbox{83} & 596 & 111 & \fbox{634} & 103 & 720 & 576 & 45 & 227 & \fbox{286} \end{array} \] Finalement \( 83^{521}=632\)
    3. Lorsque l'on applique le processus de chiffrement RSA avec \( (899, 521)\) comme clef publique a un message \( M\) , il faut réaliser l'opération \( M^e\% n\) soit ici \( M=83\) soit \( 83^{521}\) modulo \( 899\) que nous avons fait à la question précédente. Le chiffrement de \( M=83\) est donc \( 632\) .
  3. Pour déterminer la clef privé associée à \( (899, 521)\) , il suffit de déterminer l'inverse de \( 521\) modulo \( 840\) . Nous avons précédement appliquer l'algorithme d'Euclide étendue. Nous observons donc que la clef privé est \( (899, 761)\) .
  4. Comme précédement on va appliquer l'algorithme d'exponentiation modulaire rapide pour calculer \( 259^{761}\) modulo \( 899\) . \[ \begin{array}{r|*{10}{|c}} k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\\hline259^{2^k} & 259 & 67081 & 308025 & 321489 & 298116 & 299209 & 549081 & 477481 & 12544 & 734449\\mod\ 899 & \fbox{259} & 555 & 567 & \fbox{546} & \fbox{547} & \fbox{741} & \fbox{691} & \fbox{112} & 857 & \fbox{865} \end{array} \] Finalement le déchiffrement de \( 259\) est \( 55\) .