<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
>
<channel xml:lang="fr">
<title>Root Me : plateforme d'apprentissage d&#233;di&#233;e au Hacking et &#224; la S&#233;curit&#233; de l'Information</title>
<link>https://www.root-me.org/</link>
<description>Root Me est une plateforme permettant &#224; chacun de tester et d'am&#233;liorer ses connaissances dans le domaine de la s&#233;curit&#233; informatique et du hacking &#224; travers la publication de challenges, de solutions, d'articles.</description>
<language>fr</language>
<generator>SPIP - www.spip.net</generator>
<image>
<title>Root Me : plateforme d'apprentissage d&#233;di&#233;e au Hacking et &#224; la S&#233;curit&#233; de l'Information</title>
<url>https://www.root-me.org/local/cache-vignettes/L144xH144/siteon0-9a1b1.svg?1757799377</url>
<link>https://www.root-me.org/</link>
<height>144</height>
<width>144</width>
</image>
<item xml:lang="fr">
<title>NTRU | Multiple Transmission</title>
<link>https://www.root-me.org/fr/Challenges/Cryptanalyse/NTRU-Multiple-Transmission</link>
<guid isPermaLink="true">https://www.root-me.org/fr/Challenges/Cryptanalyse/NTRU-Multiple-Transmission</guid>
<dc:date>2024-12-13T15:00:39Z</dc:date>
<dc:format>text/html</dc:format>
<dc:language>fr</dc:language>
<dc:creator>
Vozec
</dc:creator>
<dc:subject>Difficile</dc:subject>
<description>
&lt;p&gt;Vous mettez la main sur un t&#233;l&#233;phone portable et vous &#234;tes s&#251;r que l'un des contacts a un secret bien gard&#233;.&lt;br class=&#034;autobr&#034; /&gt;
Le probl&#232;me est qu'il chiffre ses messages, qu'il consid&#232;re comme importants. &lt;strong&gt;Demandez-lui le drapeau&lt;/strong&gt; et d&#233;chiffrez le, il semblerait qu'il ait fait une erreur d'impl&#233;mentation...&lt;/p&gt;
&lt;div class=&#034;info&#034;&gt;
&lt;strong&gt;Sources &#224; t&#233;l&#233;charger&lt;/strong&gt;&#160;: &lt;a href=&#034;https://static.root-me.org/cryptanalyse/ch72/ch72.zip&#034; class=&#034;spip_url spip_out auto&#034; rel=&#034;nofollow external&#034;&gt;https://static.root-me.org/cryptanalyse/ch72/ch72.zip&lt;/a&gt;
&lt;/div&gt;&lt;h5&gt;Param&#232;tres de connexion au challenge&lt;/h5&gt; &lt;table class=&#034;txs mauto&#034; style=&#034;width: 100%&#034;&gt; &lt;tbody&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;H&#244;te&lt;/td&gt;&lt;td&gt;challenge01.root-me.org&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_odd&#034;&gt;&lt;td&gt;Protocole&lt;/td&gt;&lt;td&gt;TCP&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;Port&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;br/&gt;
-
&lt;a href="https://www.root-me.org/fr/Challenges/Cryptanalyse/" rel="directory"&gt;Cryptanalyse&lt;/a&gt;
</description>
</item>
<item xml:lang="fr">
<title>NTRU | Weak Parameter</title>
<link>https://www.root-me.org/fr/Challenges/Cryptanalyse/NTRU-Weak-Parameter</link>
<guid isPermaLink="true">https://www.root-me.org/fr/Challenges/Cryptanalyse/NTRU-Weak-Parameter</guid>
<dc:date>2024-12-13T15:00:32Z</dc:date>
<dc:format>text/html</dc:format>
<dc:language>fr</dc:language>
<dc:creator>
Vozec
</dc:creator>
<dc:subject>Difficile</dc:subject>
<description>
&lt;p&gt;Une fois de plus, vous acc&#233;dez &#224; un service de messagerie s&#233;curis&#233;, et l'un des contacts a un secret &#224; vous confier, &#224; vous de lui &lt;strong&gt;demander&lt;/strong&gt;&#160;! Les messages importants sont chiffr&#233;s, mais il semble que les param&#232;tres du cryptosyst&#232;me aient &#233;t&#233; ... mal choisis.&lt;br class=&#034;autobr&#034; /&gt;
Exploitez cette mis-configuration pour d&#233;chiffrer le secret.&lt;/p&gt;
&lt;div class=&#034;info&#034;&gt;
&lt;strong&gt;Sources &#224; t&#233;l&#233;charger&lt;/strong&gt;&#160;: &lt;a href=&#034;https://static.root-me.org/cryptanalyse/ch71/ch71.zip&#034; class=&#034;spip_url spip_out auto&#034; rel=&#034;nofollow external&#034;&gt;https://static.root-me.org/cryptanalyse/ch71/ch71.zip&lt;/a&gt;
&lt;/div&gt;&lt;h5&gt;Param&#232;tres de connexion au challenge&lt;/h5&gt; &lt;table class=&#034;txs mauto&#034; style=&#034;width: 100%&#034;&gt; &lt;tbody&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;H&#244;te&lt;/td&gt;&lt;td&gt;challenge01.root-me.org&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_odd&#034;&gt;&lt;td&gt;Protocole&lt;/td&gt;&lt;td&gt;TCP&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;Port&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;br/&gt;
-
&lt;a href="https://www.root-me.org/fr/Challenges/Cryptanalyse/" rel="directory"&gt;Cryptanalyse&lt;/a&gt;
</description>
</item>
<item xml:lang="fr">
<title>Goldreich Goldwasser Halevi | Weak Parameter</title>
<link>https://www.root-me.org/fr/Challenges/Cryptanalyse/Goldreich-Goldwasser-Halevi-Weak-Parameter</link>
<guid isPermaLink="true">https://www.root-me.org/fr/Challenges/Cryptanalyse/Goldreich-Goldwasser-Halevi-Weak-Parameter</guid>
<dc:date>2024-12-13T15:00:24Z</dc:date>
<dc:format>text/html</dc:format>
<dc:language>fr</dc:language>
<dc:creator>
Vozec
</dc:creator>
<dc:subject>Difficile</dc:subject>
<description>
&lt;p&gt;On vous fait l'&#233;loge d'un chiffrement qui va r&#233;volutionner la cryptographie. Votre coll&#232;gue vous parle m&#234;me d'une r&#233;sistance aux ordinateurs quantiques&#160;!&lt;br class=&#034;autobr&#034; /&gt;
Montrez lui que derri&#232;re ces mots savants, subsistent encore des d&#233;fauts dans sa mise en place.&lt;/p&gt;
-
&lt;a href="https://www.root-me.org/fr/Challenges/Cryptanalyse/" rel="directory"&gt;Cryptanalyse&lt;/a&gt;
</description>
</item>
<item xml:lang="fr">
<title>ElGamal - Attaque par fautes (Introduction)</title>
<link>https://www.root-me.org/fr/Challenges/Cryptanalyse/ElGamal-Attaque-par-fautes-Introduction</link>
<guid isPermaLink="true">https://www.root-me.org/fr/Challenges/Cryptanalyse/ElGamal-Attaque-par-fautes-Introduction</guid>
<dc:date>2024-12-13T15:00:18Z</dc:date>
<dc:format>text/html</dc:format>
<dc:language>fr</dc:language>
<dc:creator>
Vozec
</dc:creator>
<dc:subject>Moyen</dc:subject>
<description>
&lt;p&gt;Vous faites face &#224; un crypto-syst&#232;me ElGamal avec une possibilit&#233; de simuler une injection de faute dans le processus de d&#233;chiffrement.&lt;br class=&#034;autobr&#034; /&gt;
Exploitez cette vuln&#233;rabilit&#233; pour retrouver les &lt;i&gt;256&lt;/i&gt; bits de la cl&#233; priv&#233;e.&lt;br class=&#034;autobr&#034; /&gt;
Vous disposez&#160;: &lt;br /&gt;&lt;span class=&#034;spip-puce ltr&#034;&gt;&lt;b&gt;&#8211;&lt;/b&gt;&lt;/span&gt;&#160;D'un oracle de chiffrement
&lt;br /&gt;&lt;span class=&#034;spip-puce ltr&#034;&gt;&lt;b&gt;&#8211;&lt;/b&gt;&lt;/span&gt;&#160;D'un oracle de d&#233;chiffrement (avec ou sans faute)&lt;/p&gt;
&lt;p&gt;Voici un extrait du code source&#160;:&lt;/p&gt;
&lt;div class=&#034;coloration_code cadre&#034;&gt;&lt;div class=&#034;spip_python cadre&#034;&gt;&lt;div class=&#034;python&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;#!/usr/bin/env python3&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -*- coding: utf-8 -*-&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# File name : challenge.py&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Author : Vozec&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Date created : 4 Avril 2023&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; sage.&lt;span style=&#034;color: black;&#034;&gt;rings&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;finite_rings&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;integer_mod&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; square_root_mod_prime&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;random&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; randint&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; randrange&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; Crypto.&lt;span style=&#034;color: black;&#034;&gt;Util&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;number&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; long_to_bytes&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;bytes_to_long&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;os&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;flag &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;os&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;getenv&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'flag'&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'RM{fakeflag}'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;curve &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'Name'&lt;/span&gt;:&lt;span style=&#034;color: #483d8b;&#034;&gt;'secp256k1'&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'A'&lt;/span&gt;:&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'B'&lt;/span&gt;:&lt;span style=&#034;color: #ff4500;&#034;&gt;7&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'Prime'&lt;/span&gt;:&lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;^&lt;span style=&#034;color: #ff4500;&#034;&gt;256&lt;/span&gt; - &lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;^&lt;span style=&#034;color: #ff4500;&#034;&gt;32&lt;/span&gt; - &lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;^&lt;span style=&#034;color: #ff4500;&#034;&gt;9&lt;/span&gt; - &lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;^&lt;span style=&#034;color: #ff4500;&#034;&gt;8&lt;/span&gt; - &lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;^&lt;span style=&#034;color: #ff4500;&#034;&gt;7&lt;/span&gt; - &lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;^&lt;span style=&#034;color: #ff4500;&#034;&gt;6&lt;/span&gt; - &lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;^&lt;span style=&#034;color: #ff4500;&#034;&gt;4&lt;/span&gt; - &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: black;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt; ElGamal_ECC&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; &lt;span style=&#034;color: #0000cd;&#034;&gt;__init__&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;bits&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;256&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;A&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; curve&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'A'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;B&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; curve&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'B'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; Zmod&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;curve&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'Prime'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;E&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; EllipticCurve&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;A&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;B&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;P&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;E&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;gens&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;a&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; randrange&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;P&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;additive_order&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;Q&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;a&lt;/span&gt; * &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;P&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; check_point&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;x&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;y&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;y&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;^&lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;^&lt;span style=&#034;color: #ff4500;&#034;&gt;3&lt;/span&gt; + &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;A&lt;/span&gt;*&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;B&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; msg_to_point&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;m&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; compute_y&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; alpha &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;^&lt;span style=&#034;color: #ff4500;&#034;&gt;3&lt;/span&gt; + &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;A&lt;/span&gt;*&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;B&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; square_root_mod_prime&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;alpha&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; m &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;len&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;m&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;to_bytes&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; byteorder&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;big&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; + m&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;while&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; x &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;from_bytes&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;m&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;big&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; y &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; compute_y&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;check_point&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;y&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;E&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;y&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; m +&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;os&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;urandom&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; point_to_msg&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;M&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; int_length_in_byte&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;n: &lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;assert&lt;/span&gt; n &lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; length &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;while&lt;/span&gt; n:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; n &lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;8&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; length +&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; length&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;try&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; x &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;M&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; byte_len &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; int_length_in_byte&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; l &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x &lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;byte_len - &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; * &lt;span style=&#034;color: #ff4500;&#034;&gt;8&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &amp; &lt;span style=&#034;color: #ff4500;&#034;&gt;0xff&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; pt &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x &lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;byte_len - l - &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; * &lt;span style=&#034;color: #ff4500;&#034;&gt;8&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &amp; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;from_bytes&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;b&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\x&lt;/span&gt;ff&#034;&lt;/span&gt; * l&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;big&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; pt.&lt;span style=&#034;color: black;&#034;&gt;to_bytes&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;l&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; byteorder&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;big&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;except&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; b&lt;span style=&#034;color: #483d8b;&#034;&gt;'Fail to recover message from provided point'&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; encrypt&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;M&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; k &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; randint&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;curve&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'Prime'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt; - &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; c1 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; k * &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;P&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; c2 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; k * &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;Q&lt;/span&gt; + M&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;c1&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;c2&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; decrypt&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;pair&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;fault&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; inject_fault&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;a&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Inject a single bit fault in a random position&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; a ^^ &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;&lt;&lt;/span&gt; randint&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;a&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;bit_length&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; - &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; c1&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;c2 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; pair&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; a &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; inject_fault&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;a&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; fault &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;else&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;a&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; M &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; c2 - a * c1&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; M&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt; challenge:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; &lt;span style=&#034;color: #0000cd;&#034;&gt;__init__&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'''&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; ______ _ _ ______ _ _____ _ &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; | ____| | | | | ____| |/ ____| | |&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; | |__ __ _ _ _| | |_ _ _ | |__ | | | __ __ _ _ __ ___ __ _| |&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; | __/ _` | | | | | __| | | | | __| | | | |_ |/ _` | '_ ` _ &lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\\&lt;/span&gt; / _` | |&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; | | | (_| | |_| | | |_| |_| | | |____| | |__| | (_| | | | | | | (_| | |&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; |_| &lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\\&lt;/span&gt;__,_|&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\\&lt;/span&gt;__,_|_|&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\\&lt;/span&gt;__|&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\\&lt;/span&gt;__, | |______|_|&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\\&lt;/span&gt;_____|&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\\&lt;/span&gt;__,_|_| |_| |_|&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\\&lt;/span&gt;__,_|_|&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; __/ | &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; |___/ &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'''&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;:-&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'[+] Initialisation , please wait ...'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;ECC&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; ElGamal_ECC&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; menu&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'''&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;[+] Menu:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; (1) Encrypt message&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; (2) Decrypt message&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; (3) Decrypt message with a random single bit fault&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; (4) Check the secret key&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; (5) Exit&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; '''&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;:-&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;while&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; c &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034; $&gt; &#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; c &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'1'&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'2'&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'3'&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'4'&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'5'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;c&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; check&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; key &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;' Key (int): '&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;strip&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; key.&lt;span style=&#034;color: black;&#034;&gt;isdigit&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;[-] Invalid Key format '&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;elif&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;key&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;ECC&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;a&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;'&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;[+] Here is your flag: {flag}'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;[-] Invalid Key'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'[*] Quitting ...'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; exit&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; print_curve&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;'''&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Curve Informations:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;Name : {curve['Name']}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;Prime: {curve['Prime']}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;(A,B): ({curve['A']},{curve['B']})&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;Curve: {self.ECC.E}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'''&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; ask_input&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;try&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; ct &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;' Ciphertext [(x1,y1);(x2,y2)]: '&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; enc &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;tuple&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;_.&lt;span style=&#034;color: black;&#034;&gt;strip&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;for&lt;/span&gt; _ &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; point&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;:-&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;split&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;','&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;for&lt;/span&gt; point &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; ct.&lt;span style=&#034;color: black;&#034;&gt;strip&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;:-&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;split&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;';'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; enc&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;except&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'[-] Invalid Input'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; main&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;new&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;print_curve&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;while&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; choice &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;menu&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# (1) Encrypt point&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; choice &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;new&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; pt &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;' Plaintext : '&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'utf-8'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; M &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;ECC&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;msg_to_point&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;pt&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; C1&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;C2 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;ECC&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;encrypt&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;M&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;' Associed Point: &lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\t&lt;/span&gt;X=%s&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\t&lt;/span&gt;Y=%s'&lt;/span&gt;%&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;M&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;M&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;' Encrypted: &lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\t&lt;/span&gt;C1=%s&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\t&lt;/span&gt;C2=%s'&lt;/span&gt;%&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;C1&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;:&lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;C2&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;:&lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;new&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'[-] You have already encrypted message'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# (2) Decrypt point&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# (3) Decrypt point with a random fault&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;elif&lt;/span&gt; choice &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;3&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; enc &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;ask_input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; enc: &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;break&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; fault &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; choice &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;3&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;else&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;ECC&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;check_point&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;enc&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;enc&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;' Invalid Ciphertext ! Point(s) not on the curve.'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;break&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;ECC&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;check_point&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;enc&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;enc&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;' Invalid Ciphertext ! Point(s) not on the curve.'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;break&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; dec &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;ECC&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;decrypt&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;ECC&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;E&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;enc&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;enc&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;ECC&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;E&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;enc&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;enc&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;fault&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;fault&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;' Associed Point: &lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\t&lt;/span&gt;X=%s&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\t&lt;/span&gt;Y=%s'&lt;/span&gt;%&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;dec&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;dec&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;' Decrypted: %s'&lt;/span&gt;%&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;ECC&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;point_to_msg&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;dec&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# (4) Check the secret key &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;elif&lt;/span&gt; choice &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;4&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;check&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# (5) Exit&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; exit&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;test&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; ECC &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; ElGamal_ECC&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; m &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; b&lt;span style=&#034;color: #483d8b;&#034;&gt;'HelloThere :)'&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; M &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; ECC.&lt;span style=&#034;color: black;&#034;&gt;msg_to_point&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;m&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; c1&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;c2 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; ECC.&lt;span style=&#034;color: black;&#034;&gt;encrypt&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;M&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;assert&lt;/span&gt; ECC.&lt;span style=&#034;color: black;&#034;&gt;check_point&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;c1.&lt;span style=&#034;color: black;&#034;&gt;xy&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; c1.&lt;span style=&#034;color: black;&#034;&gt;xy&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;assert&lt;/span&gt; ECC.&lt;span style=&#034;color: black;&#034;&gt;check_point&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;c2.&lt;span style=&#034;color: black;&#034;&gt;xy&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; c2.&lt;span style=&#034;color: black;&#034;&gt;xy&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; dec &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; ECC.&lt;span style=&#034;color: black;&#034;&gt;decrypt&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; ECC.&lt;span style=&#034;color: black;&#034;&gt;E&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;c1.&lt;span style=&#034;color: black;&#034;&gt;xy&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; c1.&lt;span style=&#034;color: black;&#034;&gt;xy&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; ECC.&lt;span style=&#034;color: black;&#034;&gt;E&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;c2.&lt;span style=&#034;color: black;&#034;&gt;xy&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; c2.&lt;span style=&#034;color: black;&#034;&gt;xy&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;fault&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; m_dec &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; ECC.&lt;span style=&#034;color: black;&#034;&gt;point_to_msg&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;dec&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;assert&lt;/span&gt; m &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; m_dec&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; __name__ &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'__main__'&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# test()&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; challenge&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;main&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download cadre_download'&gt;&lt;a href='https://www.root-me.org/local/cache-code/530ddc64a36c2e9dc3ae6380ea816973.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;h5&gt;Param&#232;tres de connexion au challenge&lt;/h5&gt; &lt;table class=&#034;txs mauto&#034; style=&#034;width: 100%&#034;&gt; &lt;tbody&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;H&#244;te&lt;/td&gt;&lt;td&gt;challenge01.root-me.org&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_odd&#034;&gt;&lt;td&gt;Protocole&lt;/td&gt;&lt;td&gt;TCP&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;Port&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;br/&gt;
-
&lt;a href="https://www.root-me.org/fr/Challenges/Cryptanalyse/" rel="directory"&gt;Cryptanalyse&lt;/a&gt;
</description>
</item>
<item xml:lang="fr">
<title>DSA - Erreur d'impl&#233;mentation</title>
<link>https://www.root-me.org/fr/Challenges/Cryptanalyse/DSA-Erreur-d-implementation</link>
<guid isPermaLink="true">https://www.root-me.org/fr/Challenges/Cryptanalyse/DSA-Erreur-d-implementation</guid>
<dc:date>2024-12-13T15:00:10Z</dc:date>
<dc:format>text/html</dc:format>
<dc:language>fr</dc:language>
<dc:creator>
Vozec
</dc:creator>
<dc:subject>Moyen</dc:subject>
<description>
&lt;p&gt;Vous &#234;tes engag&#233; pour tester la s&#233;curit&#233; cryptographique d'une impl&#233;mentation du c&#233;l&#232;bre syst&#232;me DSA.&lt;br class=&#034;autobr&#034; /&gt;
A vous de jouer&#160;!&lt;/p&gt;
&lt;div class=&#034;coloration_code cadre&#034;&gt;&lt;div class=&#034;spip_python cadre&#034;&gt;&lt;div class=&#034;python&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; Crypto.&lt;span style=&#034;color: black;&#034;&gt;Util&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;number&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; isPrime&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; getPrime&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;os&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; getenv&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; hashlib &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; sha1&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;random&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; randint&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# https://fr.wikipedia.org/wiki/Digital_Signature_Algorithm&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt; DSA:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; &lt;span style=&#034;color: #0000cd;&#034;&gt;__init__&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; L&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1024&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; N&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;256&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;L&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; L&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;N&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; N&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;g&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;gen_params&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;x&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; randint&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;y&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;pow&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;g&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;x&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; gen_params&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; q &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; getPrime&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;L&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;while&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; p &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; q*&lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;*randint&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;2&lt;/span&gt;**&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;N&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; isPrime&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;p&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;break&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;while&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; h &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; randint&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; p-&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; g &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;pow&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;h&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;p-&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;//q&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; p&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; g &lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;break&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;p&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; q&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; g&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; H&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;: &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;from_bytes&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;sha1&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;message.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;digest&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'big'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; sign&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; Hm &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;H&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;message&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;while&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; s &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; randint&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt; - &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; s1 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;pow&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;g&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; s&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; % &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; s1 &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;continue&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; s_inv &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; modinv&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;s&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; s2 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;Hm + s1 * &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;x&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; * s_inv&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; % &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; s2 &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;continue&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;break&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; f&lt;span style=&#034;color: #483d8b;&#034;&gt;'{s1}:{s2}'&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; verify&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; signature&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;try&lt;/span&gt;: &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; s1&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; s2 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;map&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;signature.&lt;span style=&#034;color: black;&#034;&gt;split&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;':'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; Hm &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;H&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;message&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;&lt;/span&gt; s1 &lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;or&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;&lt;/span&gt; s2 &lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; w &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; modinv&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;s2&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; u1 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;Hm * w&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; % &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; u2 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;s1 * w&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; % &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; v &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;pow&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;g&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; u1&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; * &lt;span style=&#034;color: #008000;&#034;&gt;pow&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;y&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; u2&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; % &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;p&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; % &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;q&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; v &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; s1&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;except&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; egcd&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;a&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; b&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; a &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;b&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; g&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; y&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; x &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; egcd&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;b%a&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;a&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;g&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; x - &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;b//a&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; * y&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; y&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; modinv&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;a&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; m&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; g&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; x&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; y &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; egcd&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;a&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; m&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; g &lt;span style=&#034;color: #66cc66;&#034;&gt;!=&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'Modular inverse does not exist'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; x%m&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; main&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; dsa &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; DSA&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; target &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'Can I have The Flag please'&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; flag &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; getenv&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'FLAG'&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RM{REDACTED}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Here is the public key:&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\t&lt;/span&gt;- p = {dsa.p}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\t&lt;/span&gt;- q = {dsa.q}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\t&lt;/span&gt;- g = {dsa.g}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\t&lt;/span&gt;- y = {dsa.y}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;while&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;Menu:&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;1. Sign a message&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;2. Verify a message&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;3. Get the flag&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;4. Quit&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; choice &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Choose an option: &#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; choice &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;1&#034;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; message &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Enter the message to sign: &#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;strip&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; message &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; target:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'Forbidden message !'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;continue&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;sig = {dsa.sign(message)}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;elif&lt;/span&gt; choice &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;2&#034;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; message &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Enter the message to verify: &#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; signature &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Enter the signature associed: &#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; dsa.&lt;span style=&#034;color: black;&#034;&gt;verify&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;message&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; signature&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;The signature is valid.&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;The signature is invalid.&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;elif&lt;/span&gt; choice &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;3&#034;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; signature &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Enter the secret signature: &#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; dsa.&lt;span style=&#034;color: black;&#034;&gt;verify&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;target&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; signature&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Well played, here is the flag: {flag}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;The signature is invalid, get out !&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;break&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;elif&lt;/span&gt; choice &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;4&#034;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Quitting the program.&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;break&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Invalid choice. Please select a valid option.&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; __name__ &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;__main__&#034;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; main&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download cadre_download'&gt;&lt;a href='https://www.root-me.org/local/cache-code/7cf6cee87958a8e9fe8ec4428fcb9588.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;Param&#232;tres de connexion au challenge&lt;/h5&gt; &lt;table class=&#034;txs mauto&#034; style=&#034;width: 100%&#034;&gt; &lt;tbody&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;H&#244;te&lt;/td&gt;&lt;td&gt;challenge01.root-me.org&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_odd&#034;&gt;&lt;td&gt;Protocole&lt;/td&gt;&lt;td&gt;TCP&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;Port&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;br/&gt;
-
&lt;a href="https://www.root-me.org/fr/Challenges/Cryptanalyse/" rel="directory"&gt;Cryptanalyse&lt;/a&gt;
</description>
</item>
<item xml:lang="fr">
<title>Fichier - PKZIP 2</title>
<link>https://www.root-me.org/fr/Challenges/Cryptanalyse/Fichier-PKZIP-2</link>
<guid isPermaLink="true">https://www.root-me.org/fr/Challenges/Cryptanalyse/Fichier-PKZIP-2</guid>
<dc:date>2024-11-08T11:00:11Z</dc:date>
<dc:format>text/html</dc:format>
<dc:language>fr</dc:language>
<dc:creator>
kevin.mille
</dc:creator>
<dc:subject>Moyen</dc:subject>
<description>
&lt;p&gt;Mon ami m'a envoy&#233; sa collection de photos de chats, mais a oubli&#233; de me transmettre le mot de passe de l'archive ZIP.&lt;br class=&#034;autobr&#034; /&gt;
R&#233;cup&#233;rez les photos malgr&#233; tout, et vous obtiendrez le flag en r&#233;compense.&lt;/p&gt;
-
&lt;a href="https://www.root-me.org/fr/Challenges/Cryptanalyse/" rel="directory"&gt;Cryptanalyse&lt;/a&gt;
</description>
</item>
<item xml:lang="fr">
<title>AES - ECB - Copy Paste</title>
<link>https://www.root-me.org/fr/Challenges/Cryptanalyse/AES-ECB-Copy-Paste</link>
<guid isPermaLink="true">https://www.root-me.org/fr/Challenges/Cryptanalyse/AES-ECB-Copy-Paste</guid>
<dc:date>2024-02-05T11:33:20Z</dc:date>
<dc:format>text/html</dc:format>
<dc:language>fr</dc:language>
<dc:creator>
Vozec
</dc:creator>
<dc:subject>Moyen</dc:subject>
<description>
&lt;p&gt;Ce panel de connexion utilise le chiffrement AES en mode ECB pour g&#233;n&#233;rer ses tokens d'authentifications. A vous de d&#233;couvrir comment contourner ce login et acc&#233;der au secret de l'utilisateur &lt;strong&gt;admin&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Extrait du code&lt;/i&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_python code&#034;&gt;&lt;div class=&#034;python&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; login&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;token&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'Token:&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;&gt; '&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;strip&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;try&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; data &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; json.&lt;span style=&#034;color: black;&#034;&gt;loads&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;unpad&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;aes&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;decrypt&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;unhexlify&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #dc143c;&#034;&gt;token&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;16&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;decode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; data&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'username'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; users:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'[-] Unknow user'&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; data&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'username'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;admin&#034;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;and&lt;/span&gt; data&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;isAdmin&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'[+] Hello admin , here is your secret : %s'&lt;/span&gt;%flag&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;[+] Hello %s , you don't have any secret in our database&#034;&lt;/span&gt;%data&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'username'&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;except&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'[-] Invalid token !'&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; register&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;user&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;'Username:&lt;span style=&#034;color: #000099; font-weight: bold;&#034;&gt;\n&lt;/span&gt;&gt; '&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;strip&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;user&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; users:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'[-] User already exists'&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; data &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; b&lt;span style=&#034;color: #483d8b;&#034;&gt;'{&#034;username&#034;: &#034;%s&#034;, &#034;isAdmin&#034;: false}'&lt;/span&gt; %&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #dc143c;&#034;&gt;user&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;token&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; hexlify&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;aes&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;encrypt&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;pad&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;data&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;16&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;decode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; users.&lt;span style=&#034;color: black;&#034;&gt;append&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #dc143c;&#034;&gt;user&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'[+] You can use this token to access your account : %s'&lt;/span&gt; %&lt;span style=&#034;color: #dc143c;&#034;&gt;token&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://www.root-me.org/local/cache-code/00799dc348c374a33737e1da16916850.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;h5&gt;Param&#232;tres de connexion au challenge&lt;/h5&gt; &lt;table class=&#034;txs mauto&#034; style=&#034;width: 100%&#034;&gt; &lt;tbody&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;H&#244;te&lt;/td&gt;&lt;td&gt;challenge01.root-me.org&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_odd&#034;&gt;&lt;td&gt;Protocole&lt;/td&gt;&lt;td&gt;TCP&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;Port&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;br/&gt;
-
&lt;a href="https://www.root-me.org/fr/Challenges/Cryptanalyse/" rel="directory"&gt;Cryptanalyse&lt;/a&gt;
</description>
</item>
<item xml:lang="fr">
<title>Shamir Secret Sharing - Introduction </title>
<link>https://www.root-me.org/fr/Challenges/Cryptanalyse/Shamir-Secret-Sharing-Introduction</link>
<guid isPermaLink="true">https://www.root-me.org/fr/Challenges/Cryptanalyse/Shamir-Secret-Sharing-Introduction</guid>
<dc:date>2024-02-05T11:33:12Z</dc:date>
<dc:format>text/html</dc:format>
<dc:language>fr</dc:language>
<dc:creator>
Vozec
</dc:creator>
<dc:subject>Moyen</dc:subject>
<description>
&lt;p&gt;Vous vous retrouvez en possession de paires de nombres et votre coll&#232;gue, d'un coup d'&#339;il, vous assure que vous avez tout ce qu'il faut pour d&#233;chiffrer le message.&lt;/p&gt;
-
&lt;a href="https://www.root-me.org/fr/Challenges/Cryptanalyse/" rel="directory"&gt;Cryptanalyse&lt;/a&gt;
</description>
</item>
<item xml:lang="fr">
<title>Shamir Secret Sharing - Irreductible ?</title>
<link>https://www.root-me.org/fr/Challenges/Cryptanalyse/Shamir-Secret-Sharing-Irreductible</link>
<guid isPermaLink="true">https://www.root-me.org/fr/Challenges/Cryptanalyse/Shamir-Secret-Sharing-Irreductible</guid>
<dc:date>2024-02-05T11:33:04Z</dc:date>
<dc:format>text/html</dc:format>
<dc:language>fr</dc:language>
<dc:creator>
Mr7F
</dc:creator>
<dc:subject>Difficile</dc:subject>
<description>
&lt;p&gt;Il semblerait que cette fois-ci le syst&#232;me ait &#233;t&#233; renforc&#233;. Et votre ami est encore absent.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Code source&lt;/i&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_python code&#034;&gt;&lt;div class=&#034;python&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;os&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;random&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; Crypto.&lt;span style=&#034;color: black;&#034;&gt;Util&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;number&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; bytes_to_long&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; getPrime&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;DEGREE &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;10&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;BITSIZE &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;64&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;SECRET &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; get_coeff&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;p&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;while&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# os.urandom is safer than random.randint, nothing fishy here&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; coeff &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; bytes_to_long&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #dc143c;&#034;&gt;os&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;urandom&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;BITSIZE // &lt;span style=&#034;color: #ff4500;&#034;&gt;16&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: #008000;&#034;&gt;hex&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;upper&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; BITSIZE - &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;=&lt;/span&gt; coeff.&lt;span style=&#034;color: black;&#034;&gt;bit_length&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;and&lt;/span&gt; coeff &lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;&lt;/span&gt; p:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# if the coefficients are not small LLL won't work, I'm sure&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; coeff&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; generate_points&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;modulus &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;global&lt;/span&gt; SECRET&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; coefficients &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;get_coeff&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;modulus&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;for&lt;/span&gt; _ &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;range&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;DEGREE + &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; SECRET &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; coefficients&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; _eval&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;x&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; x&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;sum&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;c * x ** d &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;for&lt;/span&gt; d&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; c &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;enumerate&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;coefficients&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; % modulus&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;_eval&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #dc143c;&#034;&gt;random&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;randint&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; modulus - &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;for&lt;/span&gt; _ &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;range&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;DEGREE + &lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;p &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; getPrime&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;BITSIZE&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;points &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; generate_points&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;modulus&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;p&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;points &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; points&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #ff4500;&#034;&gt;1&lt;/span&gt;:&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;One of our friends is gone, is our secret lost ?&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;p = &#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; p&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;points = &#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; points&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;assert&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;input&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;What's our secret ? &#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; SECRET&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;We lost it&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;with&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;open&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;.passwd&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;as&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;file&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;print&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;file&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;read&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://www.root-me.org/local/cache-code/02d316d5f96a2c93bf26d1f539cee43e.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;h5&gt;Param&#232;tres de connexion au challenge&lt;/h5&gt; &lt;table class=&#034;txs mauto&#034; style=&#034;width: 100%&#034;&gt; &lt;tbody&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;H&#244;te&lt;/td&gt;&lt;td&gt;challenge01.root-me.org&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_odd&#034;&gt;&lt;td&gt;Protocole&lt;/td&gt;&lt;td&gt;TCP&lt;/td&gt;&lt;/tr&gt; &lt;tr class=&#034;row_even&#034;&gt;&lt;td&gt;Port&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;br/&gt;
-
&lt;a href="https://www.root-me.org/fr/Challenges/Cryptanalyse/" rel="directory"&gt;Cryptanalyse&lt;/a&gt;
</description>
</item>
<item xml:lang="fr">
<title>Shamir Secret Sharing - Reduction</title>
<link>https://www.root-me.org/fr/Challenges/Cryptanalyse/Shamir-Secret-Sharing-Reduction</link>
<guid isPermaLink="true">https://www.root-me.org/fr/Challenges/Cryptanalyse/Shamir-Secret-Sharing-Reduction</guid>
<dc:date>2024-02-05T11:32:55Z</dc:date>
<dc:format>text/html</dc:format>
<dc:language>fr</dc:language>
<dc:creator>
Vozec
</dc:creator>
<dc:subject>Difficile</dc:subject>
<description>
&lt;p&gt;Deux amis ont disparu et vous n'arrivez pas &#224; d&#233;chiffrer le message secret ! Utilisez vos comp&#233;tences en math&#233;matiques pour trouver le message !&lt;/p&gt;
-
&lt;a href="https://www.root-me.org/fr/Challenges/Cryptanalyse/" rel="directory"&gt;Cryptanalyse&lt;/a&gt;
</description>
</item>
</channel>
</rss>
