<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2596020075800648621</id><updated>2026-07-06T14:50:39.215-07:00</updated><category term="What is RSA?"/><title type='text'>What is RSA?</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://whatisrsa.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2596020075800648621/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://whatisrsa.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14376640606753915985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2596020075800648621.post-216278047189237437</id><published>2011-09-07T14:31:00.003-07:00</published><updated>2011-09-07T14:31:11.253-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="What is RSA?"/><title type='text'>What is RSA?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;In&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cryptography&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Cryptography&quot;&gt;cryptography&lt;/a&gt;,&amp;nbsp;&lt;b&gt;RSA&lt;/b&gt;&amp;nbsp;(which stands for&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ron_Rivest&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Ron Rivest&quot;&gt;Rivest&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Adi_Shamir&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Adi Shamir&quot;&gt;Shamir&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Leonard_Adleman&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Leonard Adleman&quot;&gt;Adleman&lt;/a&gt;&amp;nbsp;who first publicly described it) is an&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Algorithm&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Algorithm&quot;&gt;algorithm&lt;/a&gt;&amp;nbsp;for&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Public-key_cryptography&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Public-key cryptography&quot;&gt;public-key cryptography&lt;/a&gt;.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-rsa_0-0&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-rsa-0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;1&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;nbsp;It is the first algorithm known to be suitable for&lt;a href=&quot;http://en.wikipedia.org/wiki/Digital_signature&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Digital signature&quot;&gt;signing&lt;/a&gt;&amp;nbsp;as well as encryption, and was one of the first great advances in public key cryptography. RSA is widely used in&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Electronic_commerce&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Electronic commerce&quot;&gt;electronic commerce&lt;/a&gt;&amp;nbsp;protocols, and is believed to be sufficiently secure given sufficiently long keys and the use of up-to-date implementations.&lt;/div&gt;&lt;table class=&quot;toc&quot; id=&quot;toc&quot; style=&quot;background-color: #f9f9f9; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-size: 12px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;div id=&quot;toctitle&quot; style=&quot;text-align: center;&quot;&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-style: none; border-color: initial; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; border-width: initial; color: black; display: inline; font-size: 12px; font-weight: bold; margin-bottom: 0.6em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: auto;&quot;&gt;Contents&lt;/h2&gt;&amp;nbsp;&lt;span class=&quot;toctoggle&quot; style=&quot;font-size: 11px;&quot;&gt;[&lt;a class=&quot;internal&quot; href=&quot;http://en.wikipedia.org/wiki/RSA#&quot; id=&quot;togglelink&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;hide&lt;/a&gt;]&lt;/span&gt;&lt;/div&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: none; list-style-type: none; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;&quot;&gt;&lt;li class=&quot;toclevel-1 tocsection-1&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#History&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;History&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-1 tocsection-2&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Operation&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Operation&lt;/span&gt;&lt;/a&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: none; list-style-type: none; margin-bottom: 0.5em; margin-left: 2em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;&quot;&gt;&lt;li class=&quot;toclevel-2 tocsection-3&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Key_generation&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;2.1&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Key generation&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-4&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Encryption&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;2.2&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Encryption&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-5&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Decryption&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;2.3&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Decryption&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-6&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Using_the_Chinese_remainder_algorithm&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;2.4&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Using the Chinese remainder algorithm&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-7&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#A_working_example&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;2.5&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;A working example&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-8&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Attacks_against_plain_RSA&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;2.6&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Attacks against plain RSA&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-9&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Padding_schemes&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;2.7&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Padding schemes&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-10&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Signing_messages&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;2.8&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Signing messages&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-1 tocsection-11&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Security_and_practical_considerations&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Security and practical considerations&lt;/span&gt;&lt;/a&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: none; list-style-type: none; margin-bottom: 0.5em; margin-left: 2em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;&quot;&gt;&lt;li class=&quot;toclevel-2 tocsection-12&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Integer_factorization_and_RSA_problem&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;3.1&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Integer factorization and RSA problem&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-13&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Key_generation_2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;3.2&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Key generation&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-14&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Timing_attacks&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;3.3&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Timing attacks&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-15&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Adaptive_chosen_ciphertext_attacks&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;3.4&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Adaptive chosen ciphertext attacks&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-16&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Side-channel_analysis_attacks&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;3.5&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Side-channel analysis attacks&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-1 tocsection-17&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Proofs_of_correctness&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Proofs of correctness&lt;/span&gt;&lt;/a&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: none; list-style-type: none; margin-bottom: 0.5em; margin-left: 2em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;&quot;&gt;&lt;li class=&quot;toclevel-2 tocsection-18&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Concise_proof_using_Euler.27s_Theorem&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;4.1&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Concise proof using Euler&#39;s Theorem&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-2 tocsection-19&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Proof_using_Fermat.27s_Little_Theorem_and_Chinese_Remainder_Theorem&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;4.2&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Proof using Fermat&#39;s Little Theorem and Chinese Remainder Theorem&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-1 tocsection-20&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#See_also&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;5&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;See also&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-1 tocsection-21&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Notes&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;6&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;Notes&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-1 tocsection-22&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#References&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;7&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;References&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-1 tocsection-23&quot; style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#External_links&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;span class=&quot;tocnumber&quot;&gt;8&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;toctext&quot;&gt;External links&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 19px; margin-bottom: 0.6em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: History&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;History&quot;&gt;History&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Clifford_Cocks&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Clifford Cocks&quot;&gt;Clifford Cocks&lt;/a&gt;, a British&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Mathematician&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Mathematician&quot;&gt;mathematician&lt;/a&gt;&amp;nbsp;working for the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/United_Kingdom&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;United Kingdom&quot;&gt;UK&lt;/a&gt;&amp;nbsp;intelligence agency&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Government_Communications_Headquarters&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Government Communications Headquarters&quot;&gt;GCHQ&lt;/a&gt;, described an equivalent system in an internal document in 1973, but given the relatively expensive computers needed to implement it at the time, it was mostly considered a curiosity and, as far as is publicly known, was never deployed. His discovery, however, was not revealed until 1998 due to its top-secret classification, and Rivest, Shamir, and Adleman devised RSA independently of Cocks&#39; work.&lt;/div&gt;&lt;div class=&quot;thumb tright&quot; style=&quot;background-color: transparent; clear: right; float: right; margin-bottom: 1.3em; margin-left: 1.4em; margin-right: 0px; margin-top: 0.5em; width: auto;&quot;&gt;&lt;div class=&quot;thumbinner&quot; style=&quot;background-color: #f9f9f9; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; font-size: 12px; min-width: 100px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 3px !important; padding-left: 3px !important; padding-right: 3px !important; padding-top: 3px !important; text-align: center; width: 177px;&quot;&gt;&lt;a class=&quot;image&quot; href=&quot;http://en.wikipedia.org/wiki/File:Adi_Shamir_2009.jpg&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;thumbimage&quot; height=&quot;263&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Adi_Shamir_2009.jpg/175px-Adi_Shamir_2009.jpg&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; border-width: initial; vertical-align: middle;&quot; width=&quot;175&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;thumbcaption&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; font-size: 11px; line-height: 1.4em; padding-bottom: 3px !important; padding-left: 3px !important; padding-right: 3px !important; padding-top: 3px !important; text-align: left;&quot;&gt;&lt;div class=&quot;magnify&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial initial !important; background-repeat: initial initial !important; border-bottom-style: none !important; border-color: initial !important; border-left-style: none !important; border-right-style: none !important; border-top-style: none !important; border-width: initial !important; float: right;&quot;&gt;&lt;a class=&quot;internal&quot; href=&quot;http://en.wikipedia.org/wiki/File:Adi_Shamir_2009.jpg&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial initial !important; background-repeat: initial initial !important; border-bottom-style: none !important; border-color: initial !important; border-left-style: none !important; border-right-style: none !important; border-top-style: none !important; border-width: initial !important; color: #0645ad; display: block; text-decoration: none;&quot; title=&quot;Enlarge&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;11&quot; src=&quot;http://bits.wikimedia.org/skins-1.17/common/images/magnify-clip.png&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial initial !important; background-repeat: initial initial !important; border-bottom-style: none !important; border-color: initial !important; border-color: initial; border-left-style: none !important; border-right-style: none !important; border-top-style: none !important; border-width: initial !important; border-width: initial; display: block; vertical-align: middle;&quot; width=&quot;15&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Adi Shamir, one of the authors of RSA:&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ron_Rivest&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Ron Rivest&quot;&gt;Rivest&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Adi_Shamir&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Adi Shamir&quot;&gt;Shamir&lt;/a&gt;&amp;nbsp;and&lt;a href=&quot;http://en.wikipedia.org/wiki/Leonard_Adleman&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Leonard Adleman&quot;&gt;Adleman&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;The RSA algorithm was publicly described in 1978 by&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ron_Rivest&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Ron Rivest&quot;&gt;Ron Rivest&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Adi_Shamir&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Adi Shamir&quot;&gt;Adi Shamir&lt;/a&gt;, and&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Leonard_Adleman&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Leonard Adleman&quot;&gt;Leonard Adleman&lt;/a&gt;&amp;nbsp;at&lt;a href=&quot;http://en.wikipedia.org/wiki/Massachusetts_Institute_of_Technology&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Massachusetts Institute of Technology&quot;&gt;MIT&lt;/a&gt;; the letters&amp;nbsp;&lt;b&gt;RSA&lt;/b&gt;&amp;nbsp;are the initials of their surnames, listed in the same order as on the paper.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-SIAM_1-0&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-SIAM-1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;2&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Massachusetts_Institute_of_Technology&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Massachusetts Institute of Technology&quot;&gt;MIT&lt;/a&gt;&amp;nbsp;was granted&amp;nbsp;&lt;span&gt;&lt;a class=&quot;external text&quot; href=&quot;http://www.google.com/patents?vid=4405829&quot; rel=&quot;nofollow&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(data:image/png; background-origin: initial; background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: #3366bb; padding-right: 13px; text-decoration: none;&quot;&gt;U.S. Patent 4,405,829&lt;/a&gt;&lt;/span&gt;&amp;nbsp;for a &quot;Cryptographic communications system and method&quot; that used the algorithm in 1983. The patent would have expired on September 21, 2000 (the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Term_of_patent&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Term of patent&quot;&gt;term of patent&lt;/a&gt;&amp;nbsp;was 17 years at the time), but the algorithm was released to the public domain by&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/RSA_Security&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;RSA Security&quot;&gt;RSA Security&lt;/a&gt;&amp;nbsp;on 6 September 2000, two weeks earlier.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-2&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;3&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;nbsp;Since a paper describing the algorithm had been published in August 1977,&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-SIAM_1-1&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-SIAM-1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;2&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;nbsp;prior to the December 1977&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Filing_date&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Filing date&quot;&gt;filing date&lt;/a&gt;&amp;nbsp;of the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Patent_application&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Patent application&quot;&gt;patent application&lt;/a&gt;, regulations in much of the rest of the world precluded&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Patent&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Patent&quot;&gt;patents&lt;/a&gt;&amp;nbsp;elsewhere and only the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/United_States&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;United States&quot;&gt;US&lt;/a&gt;&amp;nbsp;patent was granted. Had Cocks&#39; work been publicly known, a patent in the US might not have been possible.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;From the&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Derwent_World_Patent_Index&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Derwent World Patent Index&quot;&gt;DWPI&lt;/a&gt;&#39;s abstract of the patent,&lt;/div&gt;&lt;blockquote&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;The system includes a communications channel coupled to at least one terminal having an encoding device and to at least one terminal having a decoding device. A message-to-be-transferred is enciphered to ciphertext at the encoding terminal by encoding the message as a number M in a predetermined set. That number is then raised to a first predetermined power (associated with the intended receiver) and finally computed. The remainder or residue, C, is... computed when the exponentiated number is divided by the product of two predetermined prime numbers (associated with the intended receiver).&lt;/div&gt;&lt;/blockquote&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 19px; margin-bottom: 0.6em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Operation&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Operation&quot;&gt;Operation&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;The RSA algorithm involves three steps:&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Key_(cryptography)&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Key (cryptography)&quot;&gt;key&lt;/a&gt;&amp;nbsp;generation, encryption and decryption.&lt;/div&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=3&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Key generation&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Key_generation&quot;&gt;Key generation&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;RSA involves a&amp;nbsp;&lt;b&gt;public key&lt;/b&gt;&amp;nbsp;and a&amp;nbsp;&lt;b&gt;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Private_key&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Private key&quot;&gt;private key&lt;/a&gt;.&lt;/b&gt;&amp;nbsp;The public key can be known to everyone and is used for encrypting messages. Messages encrypted with the public key can only be decrypted using the private key. The keys for the RSA algorithm are generated the following way:&lt;/div&gt;&lt;ol style=&quot;line-height: 1.5em; list-style-image: none; margin-bottom: 0.5em; margin-left: 3.2em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;Choose two distinct&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Prime_number&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Prime number&quot;&gt;prime numbers&lt;/a&gt;&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;q&lt;/i&gt;.&lt;ul style=&quot;line-height: 1.5em; list-style-image: url(data:image/png; list-style-type: square; margin-bottom: 0.5em; margin-left: 1.6em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;For security purposes, the integers&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;should be chosen at random, and should be of similar bit-length. Prime integers can be efficiently found using a&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Primality_test&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Primality test&quot;&gt;primality test&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;Compute&amp;nbsp;&lt;span style=&quot;white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;pq&lt;/i&gt;.&lt;/span&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: url(data:image/png; list-style-type: square; margin-bottom: 0.5em; margin-left: 1.6em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;is used as the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Modular_arithmetic&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Modular arithmetic&quot;&gt;modulus&lt;/a&gt;&amp;nbsp;for both the public and private keys&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;Compute&amp;nbsp;&lt;span style=&quot;white-space: nowrap;&quot;&gt;φ(&lt;i&gt;n&lt;/i&gt;) = (&lt;i&gt;p&lt;/i&gt; – 1)(&lt;i&gt;q&lt;/i&gt; – 1)&lt;/span&gt;, where φ is&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Euler%27s_totient_function&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Euler&#39;s totient function&quot;&gt;Euler&#39;s totient function&lt;/a&gt;.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;Choose an integer&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;such that&amp;nbsp;&lt;span style=&quot;white-space: nowrap;&quot;&gt;1 &amp;lt;&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;&amp;lt; φ(&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span style=&quot;white-space: nowrap;&quot;&gt;gcd(&lt;i&gt;e&lt;/i&gt;,φ(&lt;i&gt;n&lt;/i&gt;)) = 1&lt;/span&gt;, i.e.&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;and φ(&lt;i&gt;n&lt;/i&gt;) are&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Coprime&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Coprime&quot;&gt;coprime&lt;/a&gt;.&lt;ul style=&quot;line-height: 1.5em; list-style-image: url(data:image/png; list-style-type: square; margin-bottom: 0.5em; margin-left: 1.6em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;is released as the public key exponent.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;having a short&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Bit-length&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Bit-length&quot;&gt;bit-length&lt;/a&gt;&amp;nbsp;and small&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Hamming_weight&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Hamming weight&quot;&gt;Hamming weight&lt;/a&gt;&amp;nbsp;results in more efficient encryption - most commonly 0x10001 = 65537. However, small values of&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;(such as 3) have been shown to be less secure in some settings.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-Boneh_3-0&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-Boneh-3&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;4&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;Determine&amp;nbsp;&lt;span style=&quot;white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;–1&lt;/sup&gt;&amp;nbsp;mod φ(&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;; i.e.&amp;nbsp;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;is the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Modular_multiplicative_inverse&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Modular multiplicative inverse&quot;&gt;multiplicative inverse&lt;/a&gt;&amp;nbsp;of&amp;nbsp;&lt;span style=&quot;white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;mod φ(&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;.&lt;ul style=&quot;line-height: 1.5em; list-style-image: url(data:image/png; list-style-type: square; margin-bottom: 0.5em; margin-left: 1.6em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;This is more clearly stated as solve for d given (d*e)mod φ(&lt;i&gt;n&lt;/i&gt;) = 1&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;This is often computed using the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Extended Euclidean algorithm&quot;&gt;extended Euclidean algorithm&lt;/a&gt;.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;is kept as the private key exponent.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;The&amp;nbsp;&lt;b&gt;public key&lt;/b&gt;&amp;nbsp;consists of the modulus&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;and the public (or encryption) exponent&amp;nbsp;&lt;i&gt;e&lt;/i&gt;. The&amp;nbsp;&lt;b&gt;private key&lt;/b&gt;&amp;nbsp;consists of the private (or decryption) exponent&amp;nbsp;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;which must be kept secret.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Notes:&lt;/div&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: url(data:image/png; list-style-type: square; margin-bottom: 0.5em; margin-left: 1.6em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;An alternative, used by&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/PKCS1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;PKCS1&quot;&gt;PKCS#1&lt;/a&gt;, is to choose&amp;nbsp;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;matching&amp;nbsp;&lt;span style=&quot;white-space: nowrap;&quot;&gt;&lt;i&gt;de&lt;/i&gt;&amp;nbsp;≡ 1 mod λ&lt;/span&gt;&amp;nbsp;with&amp;nbsp;&lt;span style=&quot;white-space: nowrap;&quot;&gt;λ = lcm(&lt;i&gt;p&lt;/i&gt; − 1,&lt;i&gt;q&lt;/i&gt; − 1)&lt;/span&gt;, where lcm is the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Least_common_multiple&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Least common multiple&quot;&gt;least common multiple&lt;/a&gt;. Using λ instead of φ(&lt;i&gt;n&lt;/i&gt;) allows more choices for&amp;nbsp;&lt;i&gt;d&lt;/i&gt;. λ can also be defined using the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Carmichael_function&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Carmichael function&quot;&gt;Carmichael function&lt;/a&gt;, λ(&lt;i&gt;n&lt;/i&gt;).&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;The&amp;nbsp;&lt;a class=&quot;new&quot; href=&quot;http://en.wikipedia.org/w/index.php?title=ANSI_X9.31&amp;amp;action=edit&amp;amp;redlink=1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #ba0000; text-decoration: none;&quot; title=&quot;ANSI X9.31 (page does not exist)&quot;&gt;ANSI X9.31&lt;/a&gt;&amp;nbsp;standard prescribes,&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/P1363&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;P1363&quot;&gt;IEEE 1363&lt;/a&gt;&amp;nbsp;describes, and&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/PKCS1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;PKCS1&quot;&gt;PKCS#1&lt;/a&gt;&amp;nbsp;allows, that&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;match additional requirements: be&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Strong_prime&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Strong prime&quot;&gt;strong primes&lt;/a&gt;, and be different enough that&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Fermat_factorization&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Fermat factorization&quot;&gt;Fermat factorization&lt;/a&gt;&amp;nbsp;fails.&lt;/li&gt;
&lt;/ul&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=4&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Encryption&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Encryption&quot;&gt;Encryption&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Alice_and_Bob&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Alice and Bob&quot;&gt;Alice&lt;/a&gt;&amp;nbsp;transmits her public key&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;(&lt;i&gt;n&lt;/i&gt;,&lt;i&gt;e&lt;/i&gt;)&lt;/span&gt;&amp;nbsp;to&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Alice_and_Bob&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Alice and Bob&quot;&gt;Bob&lt;/a&gt;&amp;nbsp;and keeps the private key secret. Bob then wishes to send message&amp;nbsp;&lt;b&gt;M&lt;/b&gt;&amp;nbsp;to Alice.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;He first turns&amp;nbsp;&lt;b&gt;M&lt;/b&gt;&amp;nbsp;into an integer m, such that&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;0 &amp;lt;&amp;nbsp;&lt;i&gt;m&lt;/i&gt;&amp;nbsp;&amp;lt;&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;&amp;nbsp;by using an agreed-upon reversible protocol known as a&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#Padding_schemes&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot;&gt;padding scheme&lt;/a&gt;. He then computes the ciphertext&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&lt;/span&gt;&amp;nbsp;corresponding to&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;m&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/sup&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;.&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;This can be done quickly using the method of&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Exponentiation_by_squaring&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Exponentiation by squaring&quot;&gt;exponentiation by squaring&lt;/a&gt;. Bob then transmits&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&lt;/span&gt;&amp;nbsp;to Alice.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Note that at least nine values of m will yield a ciphertext c equal to m&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-4&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-4&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;5&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;, but this is very unlikely to occur in practice.&lt;/div&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=5&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Decryption&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Decryption&quot;&gt;Decryption&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Alice can recover&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;/span&gt;&amp;nbsp;from&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&lt;/span&gt;&amp;nbsp;by using her private key exponent&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/span&gt;&amp;nbsp;via computing&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;c&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/sup&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;.&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Given&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;/span&gt;, she can recover the original message&amp;nbsp;&lt;b&gt;M&lt;/b&gt;&amp;nbsp;by reversing the padding scheme.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;(In practice, there are more efficient methods of calculating&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/sup&gt;&lt;/span&gt;&amp;nbsp;using the pre computed values below.)&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=6&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Using the Chinese remainder algorithm&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Using_the_Chinese_remainder_algorithm&quot;&gt;Using the Chinese remainder algorithm&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;For efficiency many popular crypto libraries (like OpenSSL, Java and .NET) use the following optimization for decryption and signing: The following values are precomputed and stored as part of the private key:&lt;/div&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: url(data:image/png; list-style-type: square; margin-bottom: 0.5em; margin-left: 1.6em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;p&lt;/i&gt;&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;q&lt;/i&gt;&lt;/span&gt;: the primes from the key generation,&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;sub style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;P&lt;/i&gt;&lt;/sub&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;− 1)&lt;/span&gt;,&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;sub style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;Q&lt;/i&gt;&lt;/sub&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;− 1)&lt;/span&gt;&amp;nbsp;and&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;q&lt;/i&gt;&lt;sub style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;I&lt;/i&gt;&lt;i&gt;n&lt;/i&gt;&lt;i&gt;v&lt;/i&gt;&lt;/sub&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;&lt;sup style=&quot;line-height: 1em;&quot;&gt;− 1&lt;/sup&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;p&lt;/i&gt;)&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;These values allow the recipient to compute the exponentiation&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;c&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/sup&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&lt;i&gt;q&lt;/i&gt;)&lt;/span&gt;&amp;nbsp;more efficiently as follows:&lt;/div&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: url(data:image/png; list-style-type: square; margin-bottom: 0.5em; margin-left: 1.6em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;img alt=&quot;m_1 = c^{d_P}\text{ (mod }p\text{)}&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/f/2/a/f2a4b511524a02350e2ca752cf1dec51.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;img alt=&quot;m_2 = c^{d_Q}\text{ (mod }q\text{)}&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/9/f/e/9febbc37580671705e3bc6ee38142683.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;h&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&lt;sub style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;I&lt;/i&gt;&lt;i&gt;n&lt;/i&gt;&lt;i&gt;v&lt;/i&gt;&lt;/sub&gt;&amp;nbsp;* (&lt;i&gt;m&lt;/i&gt;&lt;sub style=&quot;line-height: 1em;&quot;&gt;1&lt;/sub&gt;&amp;nbsp;−&amp;nbsp;&lt;i&gt;m&lt;/i&gt;&lt;sub style=&quot;line-height: 1em;&quot;&gt;2&lt;/sub&gt;) (mod&amp;nbsp;&lt;i&gt;p&lt;/i&gt;)&lt;/span&gt;&amp;nbsp;(if&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;sub style=&quot;line-height: 1em;&quot;&gt;1&lt;/sub&gt;&amp;nbsp;&amp;lt;&amp;nbsp;&lt;i&gt;m&lt;/i&gt;&lt;sub style=&quot;line-height: 1em;&quot;&gt;2&lt;/sub&gt;&lt;/span&gt;&amp;nbsp;then some libraries compute h as&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;q&lt;/i&gt;&lt;sub style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;I&lt;/i&gt;&lt;i&gt;n&lt;/i&gt;&lt;i&gt;v&lt;/i&gt;&lt;/sub&gt;&amp;nbsp;* (&lt;i&gt;m&lt;/i&gt;&lt;sub style=&quot;line-height: 1em;&quot;&gt;1&lt;/sub&gt;&amp;nbsp;+&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;−&amp;nbsp;&lt;i&gt;m&lt;/i&gt;&lt;sub style=&quot;line-height: 1em;&quot;&gt;2&lt;/sub&gt;) (mod&amp;nbsp;&lt;i&gt;p&lt;/i&gt;)&lt;/span&gt;)&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;img alt=&quot;m = m_2 + (h*q)\,&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/b/a/2/ba25235941ae1e2c07a449464e5976e1.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;This is more efficient than computing&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;c&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/sup&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&lt;i&gt;q&lt;/i&gt;)&lt;/span&gt;&amp;nbsp;even though two modular exponentiations have to be computed. The reason is that these two modular exponentiations both use a smaller exponent and a smaller modulus.&lt;/div&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=7&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: A working example&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;A_working_example&quot;&gt;A working example&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Here is an example of RSA encryption and decryption. The parameters used here are artificially small, but one can also&amp;nbsp;&lt;a class=&quot;extiw&quot; href=&quot;http://en.wikibooks.org/wiki/Transwiki:Generate_a_keypair_using_OpenSSL&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #3366bb; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot; title=&quot;wikibooks:Transwiki:Generate a keypair using OpenSSL&quot;&gt;use OpenSSL to generate and examine a real keypair&lt;/a&gt;.&lt;/div&gt;&lt;ol style=&quot;line-height: 1.5em; list-style-image: none; margin-bottom: 0.5em; margin-left: 3.2em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;Choose two distinct prime numbers, such as&lt;br /&gt;
&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;= 61&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;= 53&lt;/span&gt;.&lt;/dd&gt;&lt;/dl&gt;&lt;/li&gt;&lt;br /&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;Compute&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&lt;i&gt;q&lt;/i&gt;&lt;/span&gt;&amp;nbsp;giving&lt;br /&gt;
&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;n = 61 · 53 = 3233.&lt;/dd&gt;&lt;/dl&gt;&lt;/li&gt;&lt;br /&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;Compute the&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Totient&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Totient&quot;&gt;totient&lt;/a&gt;&amp;nbsp;of the product as&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;φ(&lt;i&gt;n&lt;/i&gt;) = (&lt;i&gt;p&lt;/i&gt;&amp;nbsp;− 1)(&lt;i&gt;q&lt;/i&gt;&amp;nbsp;− 1)&lt;/span&gt;&amp;nbsp;giving&lt;br /&gt;
&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;φ(3233) = (61 − 1)(53 − 1) = 3120&lt;/span&gt;.&lt;/dd&gt;&lt;/dl&gt;&lt;/li&gt;&lt;br /&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;Choose any number&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;1 &amp;lt;&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;&amp;lt; 3120&lt;/span&gt;&amp;nbsp;that is&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Coprime&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Coprime&quot;&gt;coprime&lt;/a&gt;&amp;nbsp;to 3120. Choosing a prime number for&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/span&gt;&amp;nbsp;leaves us only to check that&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/span&gt;&amp;nbsp;is not a divisor of 3120.&lt;br /&gt;
&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;Let&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;= 17&lt;/span&gt;.&lt;/dd&gt;&lt;/dl&gt;&lt;/li&gt;&lt;br /&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;Compute&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/span&gt;, the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Modular_multiplicative_inverse&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Modular multiplicative inverse&quot;&gt;modular multiplicative inverse&lt;/a&gt;&amp;nbsp;of&amp;nbsp;&lt;img alt=&quot;e\text{ (mod }\varphi(n)\text{)}&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/7/4/9/749978d592857a20cfd0d25b7c7c91cd.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&amp;nbsp;yielding&lt;br /&gt;
&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;= 2753&lt;/span&gt;.&lt;/dd&gt;&lt;/dl&gt;&lt;/li&gt;&lt;br /&gt;
&lt;/ol&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;The&amp;nbsp;&lt;b&gt;public key&lt;/b&gt;&amp;nbsp;is (&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;= 3233&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;= 17&lt;/span&gt;). For a padded&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Plaintext&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Plaintext&quot;&gt;plaintext&lt;/a&gt;&amp;nbsp;message&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;/span&gt;, the encryption function is&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;17&lt;/sup&gt;&amp;nbsp;(mod 3233)&lt;/span&gt;.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;The&amp;nbsp;&lt;b&gt;private key&lt;/b&gt;&amp;nbsp;is (&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;= 3233&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;= 2753&lt;/span&gt;). For an encrypted&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ciphertext&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Ciphertext&quot;&gt;ciphertext&lt;/a&gt;&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&lt;/span&gt;, the decryption function is&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;2753&lt;/sup&gt;&amp;nbsp;(mod 3233)&lt;/span&gt;.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;For instance, in order to encrypt&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&amp;nbsp;= 65&lt;/span&gt;, we calculate&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&amp;nbsp;= 65&lt;sup style=&quot;line-height: 1em;&quot;&gt;17&lt;/sup&gt;&amp;nbsp;(mod 3233) = 2790&lt;/span&gt;.&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;To decrypt&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&amp;nbsp;= 2790&lt;/span&gt;, we calculate&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&amp;nbsp;= 2790&lt;sup style=&quot;line-height: 1em;&quot;&gt;2753&lt;/sup&gt;&amp;nbsp;(mod 3233) = 65&lt;/span&gt;.&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Both of these calculations can be computed efficiently using the&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Square-and-multiply_algorithm&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Square-and-multiply algorithm&quot;&gt;square-and-multiply algorithm&lt;/a&gt;&amp;nbsp;for&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Modular_exponentiation&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Modular exponentiation&quot;&gt;modular exponentiation&lt;/a&gt;. In real life situations the primes selected would be much larger; in our example it would be relatively trivial to factor&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;, 3233, obtained from the freely available public key back to the primes&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;p&lt;/i&gt;&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;q&lt;/i&gt;&lt;/span&gt;. Given&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/span&gt;, also from the public key, we could then compute&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/span&gt;&amp;nbsp;and so acquire the private key.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Practical implementations use Chinese Remainder theorem to speed up the calculation using modulus of factors (mod p*q using mod p and mod q).&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;The values dp, dq and qInv, which are part of the private key are computed as follows:&lt;/div&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: url(data:image/png; list-style-type: square; margin-bottom: 0.5em; margin-left: 1.6em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;mod (&lt;i&gt;p&lt;/i&gt;&amp;nbsp;− 1) = 2753 mod (61 − 1) = 53&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;mod (&lt;i&gt;q&lt;/i&gt;&amp;nbsp;− 1) = 2753 mod (53 − 1) = 49&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;q&lt;/i&gt;&lt;i&gt;I&lt;/i&gt;&lt;i&gt;n&lt;/i&gt;&lt;i&gt;v&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;&lt;sup style=&quot;line-height: 1em;&quot;&gt;− 1&lt;/sup&gt;&amp;nbsp;mod&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;= 53&amp;nbsp;&lt;sup style=&quot;line-height: 1em;&quot;&gt;− 1&lt;/sup&gt;&amp;nbsp;mod 61 = 38&lt;/span&gt;&amp;nbsp;(Hence:&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;q&lt;/i&gt;&lt;i&gt;I&lt;/i&gt;&lt;i&gt;n&lt;/i&gt;&lt;i&gt;v&lt;/i&gt;&amp;nbsp;*&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;mod&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;= 38 * 53 mod 61 = 1&lt;/span&gt;&amp;nbsp;)&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Here is how dp, dq and qInv are used for efficient decryption. (Encryption is efficient by choice of public exponent e)&lt;/div&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: url(data:image/png; list-style-type: square; margin-bottom: 0.5em; margin-left: 1.6em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;1 =&amp;nbsp;&lt;i&gt;c&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;i&gt;p&lt;/i&gt;&lt;/sup&gt;&amp;nbsp;mod&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;= 2790&lt;sup style=&quot;line-height: 1em;&quot;&gt;53&lt;/sup&gt;&amp;nbsp;mod 61 = 4&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;2 =&amp;nbsp;&lt;i&gt;c&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;i&gt;q&lt;/i&gt;&lt;/sup&gt;&amp;nbsp;mod&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;= 2790&lt;sup style=&quot;line-height: 1em;&quot;&gt;49&lt;/sup&gt;&amp;nbsp;mod 53 = 12&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;h&lt;/i&gt;&amp;nbsp;= (&lt;i&gt;q&lt;/i&gt;&lt;i&gt;I&lt;/i&gt;&lt;i&gt;n&lt;/i&gt;&lt;i&gt;v&lt;/i&gt;&amp;nbsp;* (&lt;i&gt;m&lt;/i&gt;1 −&amp;nbsp;&lt;i&gt;m&lt;/i&gt;2)) mod&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;= (38 * − 8) mod 61 = 1&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;m&lt;/i&gt;2 +&amp;nbsp;&lt;i&gt;h&lt;/i&gt;&amp;nbsp;*&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;= 12 + 1 * 53 = 65&lt;/span&gt;&amp;nbsp;(same as above but computed more efficiently)&lt;/li&gt;
&lt;/ul&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=8&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Attacks against plain RSA&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Attacks_against_plain_RSA&quot;&gt;Attacks against plain RSA&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;There are a number of attacks against plain RSA as described below.&lt;/div&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: url(data:image/png; list-style-type: square; margin-bottom: 0.5em; margin-left: 1.6em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;When encrypting with low encryption exponents (e.g.,&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;= 3&lt;/span&gt;) and small values of the&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;/span&gt;, (i.e.&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&amp;nbsp;&amp;lt;&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;1 /&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&lt;/sup&gt;&lt;/span&gt;) the result of&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/sup&gt;&lt;/span&gt;&amp;nbsp;is strictly less than the modulus&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;. In this case, ciphertexts can be easily decrypted by taking the&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/span&gt;th root of the ciphertext over the integers.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;If the same clear text message is sent to&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/span&gt;&amp;nbsp;or more recipients in an encrypted way, and the receivers share the same exponent&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/span&gt;, but different&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;p&lt;/i&gt;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;q&lt;/i&gt;&lt;/span&gt;, and therefore&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;, then it is easy to decrypt the original clear text message via the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Chinese_remainder_theorem&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Chinese remainder theorem&quot;&gt;Chinese remainder theorem&lt;/a&gt;.&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Johan_H%C3%A5stad&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Johan Håstad&quot;&gt;Johan Håstad&lt;/a&gt;noticed that this attack is possible even if the cleartexts are not equal, but the attacker knows a linear relation between them.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-5&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-5&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;6&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;nbsp;This attack was later improved by&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Don_Coppersmith&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Don Coppersmith&quot;&gt;Don Coppersmith&lt;/a&gt;.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-6&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-6&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;7&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;rellink boilerplate seealso&quot; style=&quot;font-style: italic; margin-bottom: 0.5em; padding-left: 2em;&quot;&gt;See also:&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Coppersmith%27s_Attack&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Coppersmith&#39;s Attack&quot;&gt;Coppersmith&#39;s Attack&lt;/a&gt;&lt;/div&gt;&lt;ul style=&quot;line-height: 1.5em; list-style-image: url(data:image/png; list-style-type: square; margin-bottom: 0.5em; margin-left: 1.6em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;Because RSA encryption is a&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Deterministic_algorithm&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Deterministic algorithm&quot;&gt;deterministic encryption algorithm&lt;/a&gt;&amp;nbsp;– i.e., has no random component – an attacker can successfully launch a&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Chosen_plaintext_attack&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Chosen plaintext attack&quot;&gt;chosen plaintext attack&lt;/a&gt;&amp;nbsp;against the cryptosystem, by encrypting likely plaintexts under the public key and test if they are equal to the ciphertext. A cryptosystem is called&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Semantically_secure&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Semantically secure&quot;&gt;semantically secure&lt;/a&gt;&amp;nbsp;if an attacker cannot distinguish two encryptions from each other even if the attacker knows (or has chosen) the corresponding plaintexts. As described above, RSA without padding is not semantically secure.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;RSA has the property that the product of two ciphertexts is equal to the encryption of the product of the respective plaintexts. That is&amp;nbsp;&lt;img alt=&quot;m_1^em_2^e\equiv (m_1m_2)^e\text{ (mod }n\text{)}.&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/2/d/b/2dbf2805b4a139fee6ce5d31267643d0.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&amp;nbsp;Because of this multiplicative property a&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Chosen-ciphertext_attack&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Chosen-ciphertext attack&quot;&gt;chosen-ciphertext attack&lt;/a&gt;&amp;nbsp;is possible. E.g. an attacker, who wants to know the decryption of a ciphertext&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;m&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/sup&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;&amp;nbsp;may ask the holder of the private key to decrypt an unsuspicious-looking ciphertext&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&#39; =&amp;nbsp;&lt;i&gt;c&lt;/i&gt;&lt;i&gt;r&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/sup&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;&amp;nbsp;for some value&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;r&lt;/i&gt;&lt;/span&gt;&amp;nbsp;chosen by the attacker. Because of the multiplicative property&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&#39;&lt;/span&gt;&amp;nbsp;is the encryption of&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;i&gt;r&lt;/i&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;. Hence, if the attacker is successful with the attack, he will learn&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;i&gt;r&lt;/i&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;&amp;nbsp;from which he can derive the message&amp;nbsp;&lt;i&gt;m&lt;/i&gt;&amp;nbsp;by multiplying&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;i&gt;r&lt;/i&gt;&lt;/span&gt;&amp;nbsp;with the modular inverse of&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;r&lt;/i&gt;&lt;/span&gt;&amp;nbsp;modulo&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=9&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Padding schemes&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Padding_schemes&quot;&gt;Padding schemes&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;To avoid these problems, practical RSA implementations typically embed some form of structured, randomized&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Padding_(cryptography)&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Padding (cryptography)&quot;&gt;padding&lt;/a&gt;&amp;nbsp;into the value&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;/span&gt;before encrypting it. This padding ensures that&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;/span&gt;&amp;nbsp;does not fall into the range of insecure plaintexts, and that a given message, once padded, will encrypt to one of a large number of different possible ciphertexts.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Standards such as&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/PKCS1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;PKCS1&quot;&gt;PKCS#1&lt;/a&gt;&amp;nbsp;have been carefully designed to securely pad messages prior to RSA encryption. Because these schemes pad the plaintext&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;/span&gt;&amp;nbsp;with some number of additional bits, the size of the un-padded message&amp;nbsp;&lt;b&gt;M&lt;/b&gt;&amp;nbsp;must be somewhat smaller. RSA padding schemes must be carefully designed so as to prevent sophisticated attacks which may be facilitated by a predictable message structure. Early versions of the PKCS#1 standard (up to version 1.5) used a construction that turned RSA into a semantically secure encryption scheme. This version was later found vulnerable to a practical&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Adaptive_chosen_ciphertext_attack&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Adaptive chosen ciphertext attack&quot;&gt;adaptive chosen ciphertext attack&lt;/a&gt;. Later versions of the standard include&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Optimal Asymmetric Encryption Padding&quot;&gt;Optimal Asymmetric Encryption Padding&lt;/a&gt;&amp;nbsp;(OAEP), which prevents these attacks. The PKCS#1 standard also incorporates processing schemes designed to provide additional security for RSA signatures, e.g., the Probabilistic Signature Scheme for RSA (&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/RSA-PSS&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;RSA-PSS&quot;&gt;RSA-PSS&lt;/a&gt;).&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;In the common case where RSA is used to exchange symmetric keys,&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Key_encapsulation&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Key encapsulation&quot;&gt;key encapsulation&lt;/a&gt;&amp;nbsp;provides a simpler alternative to padding. Instead of generating a random symmetric key, padding it and then encrypting the padded version with RSA, a random integer&amp;nbsp;&lt;i&gt;m&lt;/i&gt;&amp;nbsp;between 1 and&amp;nbsp;&lt;i&gt;n&lt;/i&gt;-1 is generated and encrypted directly using RSA. Both the sender and receiver generate identical symmetric keys by applying the same&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Key_derivation_function&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Key derivation function&quot;&gt;key derivation function&lt;/a&gt;&amp;nbsp;to&amp;nbsp;&lt;i&gt;m.&lt;/i&gt;&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-7&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-7&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;8&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/div&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=10&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Signing messages&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Signing_messages&quot;&gt;Signing messages&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Suppose&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Alice_and_Bob&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Alice and Bob&quot;&gt;Alice&lt;/a&gt;&amp;nbsp;uses&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Alice_and_Bob&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Alice and Bob&quot;&gt;Bob&lt;/a&gt;&#39;s public key to send him an encrypted message. In the message, she can claim to be Alice but Bob has no way of verifying that the message was actually from Alice since anyone can use Bob&#39;s public key to send him encrypted messages. In order to verify the origin of a message, RSA can also be used to&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Digital_signature&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Digital signature&quot;&gt;sign&lt;/a&gt;&amp;nbsp;a message.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Suppose Alice wishes to send a signed message to Bob. She can use her own private key to do so. She produces a&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cryptographic_hash_function&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Cryptographic hash function&quot;&gt;hash value&lt;/a&gt;&amp;nbsp;of the message, raises it to the power of&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;mod&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;&amp;nbsp;(as she does when decrypting a message), and attaches it as a &quot;signature&quot; to the message. When Bob receives the signed message, he uses the same hash algorithm in conjunction with Alice&#39;s public key. He raises the signature to the power of&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;mod&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;&amp;nbsp;(as he does when encrypting a message), and compares the resulting hash value with the message&#39;s actual hash value. If the two agree, he knows that the author of the message was in possession of Alice&#39;s private key, and that the message has not been tampered with since.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Secure padding schemes such as&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/RSA-PSS&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;RSA-PSS&quot;&gt;RSA-PSS&lt;/a&gt;&amp;nbsp;are as essential for the security of message signing as they are for message encryption. The same key should never be used for both encryption and signing.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-8&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-8&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;9&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/div&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 19px; margin-bottom: 0.6em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=11&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Security and practical considerations&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Security_and_practical_considerations&quot;&gt;Security and practical considerations&lt;/span&gt;&lt;/h2&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=12&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Integer factorization and RSA problem&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Integer_factorization_and_RSA_problem&quot;&gt;Integer factorization and RSA problem&lt;/span&gt;&lt;/h3&gt;&lt;div class=&quot;rellink boilerplate seealso&quot; style=&quot;font-style: italic; margin-bottom: 0.5em; padding-left: 2em;&quot;&gt;See also:&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA_Factoring_Challenge&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;RSA Factoring Challenge&quot;&gt;RSA Factoring Challenge&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Integer_factorization_records&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Integer factorization records&quot;&gt;Integer factorization records&lt;/a&gt;,&amp;nbsp;and&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Shor%27s_algorithm&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Shor&#39;s algorithm&quot;&gt;Shor&#39;s algorithm&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;The security of the RSA cryptosystem is based on two mathematical problems: the problem of&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Integer_factorization&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Integer factorization&quot;&gt;factoring large numbers&lt;/a&gt;&amp;nbsp;and the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA_problem&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;RSA problem&quot;&gt;RSA problem&lt;/a&gt;. Full decryption of an RSA ciphertext is thought to be infeasible on the assumption that both of these problems are hard, i.e., no efficient algorithm exists for solving them. Providing security against&amp;nbsp;&lt;i&gt;partial&lt;/i&gt;&amp;nbsp;decryption may require the addition of a secure&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Padding_(cryptography)&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Padding (cryptography)&quot;&gt;padding scheme&lt;/a&gt;.&lt;sup class=&quot;Template-Fact&quot; style=&quot;line-height: 1em; white-space: nowrap;&quot;&gt;[&lt;i&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Wikipedia:Citation_needed&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Wikipedia:Citation needed&quot;&gt;&lt;span title=&quot;This claim needs references to reliable sources from January 2009&quot;&gt;citation needed&lt;/span&gt;&lt;/a&gt;&lt;/i&gt;]&lt;/sup&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;The&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA_problem&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;RSA problem&quot;&gt;RSA problem&lt;/a&gt;&amp;nbsp;is defined as the task of taking&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/span&gt;th roots modulo a composite&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;: recovering a value&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;/span&gt;&amp;nbsp;such that&amp;nbsp;&lt;img alt=&quot;c\equiv m^e\text{ (mod }n\text{)}&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/7/9/1/79116b085618caaf30787db724ba43c2.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; vertical-align: middle;&quot; /&gt;, where&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;(&lt;i&gt;n&lt;/i&gt;,&lt;i&gt;e&lt;/i&gt;)&lt;/span&gt;&amp;nbsp;is an RSA public key and&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&lt;/span&gt;&amp;nbsp;is an RSA ciphertext. Currently the most promising approach to solving the RSA problem is to factor the modulus&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;. With the ability to recover prime factors, an attacker can compute the secret exponent&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/span&gt;&amp;nbsp;from a public key&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;(&lt;i&gt;n&lt;/i&gt;,&lt;i&gt;e&lt;/i&gt;)&lt;/span&gt;, then decrypt&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&lt;/span&gt;&amp;nbsp;using the standard procedure. To accomplish this, an attacker factors&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;&amp;nbsp;into&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;p&lt;/i&gt;&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;q&lt;/i&gt;&lt;/span&gt;, and computes&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;(&lt;i&gt;p&lt;/i&gt;&amp;nbsp;− 1)(&lt;i&gt;q&lt;/i&gt;&amp;nbsp;− 1)&lt;/span&gt;&amp;nbsp;which allows the determination of&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/span&gt;&amp;nbsp;from&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/span&gt;. No polynomial-time method for factoring large integers on a classical computer has yet been found, but it has not been proven that none exists. See&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Integer_factorization&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Integer factorization&quot;&gt;integer factorization&lt;/a&gt;&amp;nbsp;for a discussion of this problem. Rivest, Shamir and Adleman have shown that finding&lt;i&gt;d&lt;/i&gt;&amp;nbsp;from&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;is equally hard as factoring&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;into&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;q&lt;/i&gt;.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-rsa_0-1&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-rsa-0&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;1&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;nbsp;However, this proof does not imply that inverting RSA is equally hard as factoring.&lt;sup class=&quot;Template-Fact&quot; style=&quot;line-height: 1em; white-space: nowrap;&quot;&gt;[&lt;i&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Wikipedia:Citation_needed&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Wikipedia:Citation needed&quot;&gt;&lt;span title=&quot;This claim needs references to reliable sources from May 2011&quot;&gt;citation needed&lt;/span&gt;&lt;/a&gt;&lt;/i&gt;]&lt;/sup&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;As of 2010, the largest (known) number factored by a&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/General_number_field_sieve&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;General number field sieve&quot;&gt;general-purpose factoring&lt;/a&gt;&amp;nbsp;algorithm was 768 bits long (see&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/RSA-768&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;RSA-768&quot;&gt;RSA-768&lt;/a&gt;), using a state-of-the-art distributed implementation. RSA keys are typically 1024–2048 bits long. Some experts believe that 1024-bit keys may become breakable in the near future (though this is disputed); few see any way that 4096-bit keys could be broken in the foreseeable future. Therefore, it is generally presumed that RSA is secure if&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;&amp;nbsp;is sufficiently large. If&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;&amp;nbsp;is 300&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Bit&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Bit&quot;&gt;bits&lt;/a&gt;&amp;nbsp;or shorter, it can be factored in a few hours on a&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Personal_computer&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Personal computer&quot;&gt;personal computer&lt;/a&gt;, using software already freely available. Keys of 512 bits have been shown to be practically breakable in 1999 when&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/RSA-155&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;RSA-155&quot;&gt;RSA-155&lt;/a&gt;&amp;nbsp;was factored by using several hundred computers and are now factored in a few weeks using common hardware.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-9&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-9&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;10&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;nbsp;A theoretical hardware device named&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/TWIRL&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;TWIRL&quot;&gt;TWIRL&lt;/a&gt;&amp;nbsp;and described by Shamir and Tromer in 2003 called into question the security of 1024 bit keys. It is currently recommended that&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;&amp;nbsp;be at least 2048 bits long.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-10&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-10&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;11&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;In 1994,&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Peter_Shor&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Peter Shor&quot;&gt;Peter Shor&lt;/a&gt;&amp;nbsp;showed that a&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Quantum_computer&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Quantum computer&quot;&gt;quantum computer&lt;/a&gt;&amp;nbsp;(if one could ever be practically created for the purpose) would be able to factor in&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Polynomial_time&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Polynomial time&quot;&gt;polynomial time&lt;/a&gt;, breaking RSA.&lt;/div&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=13&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Key generation&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Key_generation_2&quot;&gt;Key generation&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Finding the large primes&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;is usually done by testing random numbers of the right size with probabilistic&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Primality_test&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Primality test&quot;&gt;primality tests&lt;/a&gt;&amp;nbsp;which quickly eliminate virtually all non-primes.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Numbers&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;should not be &#39;too close&#39;, lest the&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Fermat_factorization&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Fermat factorization&quot;&gt;Fermat factorization&lt;/a&gt;&amp;nbsp;for&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;be successful, if&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;−&amp;nbsp;&lt;i&gt;q&lt;/i&gt;, for instance is less than 2&lt;i&gt;n&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;1/4&lt;/sup&gt;&amp;nbsp;(which for even small 1024-bit values of&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;is 3×10&lt;sup style=&quot;line-height: 1em;&quot;&gt;77&lt;/sup&gt;) solving for&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;is trivial. Furthermore, if either&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;−&amp;nbsp;1 or&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;−&amp;nbsp;1 has only small prime factors,&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;can be factored quickly by&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Pollard%27s_p_%E2%88%92_1_algorithm&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Pollard&#39;s p − 1 algorithm&quot;&gt;Pollard&#39;s&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;−&amp;nbsp;1 algorithm&lt;/a&gt;, and these values of&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;or&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;should therefore be discarded as well.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;It is important that the private key&amp;nbsp;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;be large enough.&amp;nbsp;&lt;a class=&quot;new&quot; href=&quot;http://en.wikipedia.org/w/index.php?title=Michael_J._Wiener&amp;amp;action=edit&amp;amp;redlink=1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #ba0000; text-decoration: none;&quot; title=&quot;Michael J. Wiener (page does not exist)&quot;&gt;Michael J. Wiener&lt;/a&gt;&amp;nbsp;showed&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-wiener_11-0&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-wiener-11&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;12&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;nbsp;that if&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;is between&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;and 2&lt;i&gt;q&lt;/i&gt;&amp;nbsp;(which is quite typical) and&lt;i&gt;d&lt;/i&gt;&amp;nbsp;&amp;lt;&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;1/4&lt;/sup&gt;/3, then&amp;nbsp;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;can be computed efficiently from&amp;nbsp;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;e&lt;/i&gt;.&lt;/div&gt;&lt;div class=&quot;rellink boilerplate seealso&quot; style=&quot;font-style: italic; margin-bottom: 0.5em; padding-left: 2em;&quot;&gt;See also:&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Wiener%27s_Attack&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Wiener&#39;s Attack&quot;&gt;Wiener&#39;s Attack&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;There is no known attack against small public exponents such as&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;=&amp;nbsp;3, provided that proper padding is used. However, when no padding is used, or when the padding is improperly implemented, small public exponents have a greater risk of leading to an attack, such as the unpadded plaintext vulnerability listed above.&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/65537&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;65537&quot;&gt;65537&lt;/a&gt;&amp;nbsp;is a commonly used value for&amp;nbsp;&lt;i&gt;e&lt;/i&gt;. This value can be regarded as a compromise between avoiding potential small exponent attacks and still allowing efficient encryptions (or signature verification). The NIST Special Publication on Computer Security (SP 800-78 Rev 1 of August 2007) does not allow public exponents&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;smaller than 65537, but does not state a reason for this restriction.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;This procedure raises additional security issues. For instance, it is of utmost importance to use a strong&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Random_number_generator&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Random number generator&quot;&gt;random number generator&lt;/a&gt;&amp;nbsp;for the symmetric key, because otherwise Eve (an eavesdropper wanting to see what was sent) could bypass RSA by guessing the symmetric key.&lt;/div&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=14&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Timing attacks&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Timing_attacks&quot;&gt;Timing attacks&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Paul_Kocher&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Paul Kocher&quot;&gt;Kocher&lt;/a&gt;&amp;nbsp;described a new attack on RSA in 1995: if the attacker Eve knows Alice&#39;s hardware in sufficient detail and is able to measure the decryption times for several known ciphertexts, she can deduce the decryption key&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/span&gt;&amp;nbsp;quickly. This attack can also be applied against the RSA signature scheme. In 2003,&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Dan_Boneh&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Dan Boneh&quot;&gt;Boneh&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/David_Brumley&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;David Brumley&quot;&gt;Brumley&lt;/a&gt;&amp;nbsp;demonstrated a more practical attack capable of recovering RSA factorizations over a network connection (e.g., from a&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Secure_Socket_Layer&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Secure Socket Layer&quot;&gt;Secure Socket Layer&lt;/a&gt;&amp;nbsp;(SSL)-enabled webserver)&lt;sup class=&quot;Template-Fact&quot; style=&quot;line-height: 1em; white-space: nowrap;&quot;&gt;[&lt;i&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Wikipedia:Citation_needed&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Wikipedia:Citation needed&quot;&gt;&lt;span title=&quot;This claim needs references to reliable sources from February 2011&quot;&gt;citation needed&lt;/span&gt;&lt;/a&gt;&lt;/i&gt;]&lt;/sup&gt;. This attack takes advantage of information leaked by the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Chinese_remainder_theorem&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Chinese remainder theorem&quot;&gt;Chinese remainder theorem&lt;/a&gt;&amp;nbsp;optimization used by many RSA implementations.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;One way to thwart these attacks is to ensure that the decryption operation takes a constant amount of time for every ciphertext. However, this approach can significantly reduce performance. Instead, most RSA implementations use an alternate technique known as&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Blinding_(cryptography)&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Blinding (cryptography)&quot;&gt;cryptographic blinding&lt;/a&gt;. RSA blinding makes use of the multiplicative property of RSA. Instead of computing&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;c&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/sup&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;, Alice first chooses a secret random value&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;r&lt;/i&gt;&lt;/span&gt;&amp;nbsp;and computes&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;(&lt;i&gt;r&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;/sup&gt;&lt;i&gt;c&lt;/i&gt;)&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/sup&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;. The result of this computation after applying&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Euler%27s_Theorem&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Euler&#39;s Theorem&quot;&gt;Euler&#39;s Theorem&lt;/a&gt;&amp;nbsp;is&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;r&lt;/i&gt;&lt;i&gt;c&lt;/i&gt;&lt;sup style=&quot;line-height: 1em;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/sup&gt;&amp;nbsp;(mod&amp;nbsp;&lt;i&gt;n&lt;/i&gt;)&lt;/span&gt;&amp;nbsp;and so the effect of&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;r&lt;/i&gt;&lt;/span&gt;&amp;nbsp;can be removed by multiplying by its inverse. A new value of&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;r&lt;/i&gt;&lt;/span&gt;&amp;nbsp;is chosen for each ciphertext. With blinding applied, the decryption time is no longer correlated to the value of the input ciphertext and so the timing attack fails.&lt;/div&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=15&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Adaptive chosen ciphertext attacks&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Adaptive_chosen_ciphertext_attacks&quot;&gt;Adaptive chosen ciphertext attacks&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;In 1998,&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Daniel_Bleichenbacher&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Daniel Bleichenbacher&quot;&gt;Daniel Bleichenbacher&lt;/a&gt;&amp;nbsp;described the first practical&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Adaptive_chosen_ciphertext_attack&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Adaptive chosen ciphertext attack&quot;&gt;adaptive chosen ciphertext attack&lt;/a&gt;, against RSA-encrypted messages using the PKCS #1 v1&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Padding_(cryptography)&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Padding (cryptography)&quot;&gt;padding scheme&lt;/a&gt;&amp;nbsp;(a padding scheme randomizes and adds structure to an RSA-encrypted message, so it is possible to determine whether a decrypted message is valid.) Due to flaws with the PKCS #1 scheme, Bleichenbacher was able to mount a practical attack against RSA implementations of the&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Secure_Socket_Layer&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Secure Socket Layer&quot;&gt;Secure Socket Layer&lt;/a&gt;&amp;nbsp;protocol, and to recover session keys. As a result of this work, cryptographers now recommend the use of provably secure padding schemes such as&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Optimal Asymmetric Encryption Padding&quot;&gt;Optimal Asymmetric Encryption Padding&lt;/a&gt;, and RSA Laboratories has released new versions of PKCS #1 that are not vulnerable to these attacks.&lt;/div&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=16&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Side-channel analysis attacks&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Side-channel_analysis_attacks&quot;&gt;Side-channel analysis attacks&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;A side-channel attack using branch prediction analysis (BPA) has been described. Many processors use a&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Branch_predictor&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Branch predictor&quot;&gt;branch predictor&lt;/a&gt;&amp;nbsp;to determine whether a conditional branch in the instruction flow of a program is likely to be taken or not. Often these processors also implement&lt;a href=&quot;http://en.wikipedia.org/wiki/Simultaneous_multithreading&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Simultaneous multithreading&quot;&gt;simultaneous multithreading&lt;/a&gt;&amp;nbsp;(SMT). Branch prediction analysis attacks use a spy process to discover (statistically) the private key when processed with these processors.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Simple Branch Prediction Analysis (SBPA) claims to improve BPA in a non-statistical way. In their paper, &quot;On the Power of Simple Branch Prediction Analysis&quot;,&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-12&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-12&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;13&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;nbsp;the authors of SBPA (&lt;a class=&quot;new&quot; href=&quot;http://en.wikipedia.org/w/index.php?title=Onur_Aciicmez&amp;amp;action=edit&amp;amp;redlink=1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #ba0000; text-decoration: none;&quot; title=&quot;Onur Aciicmez (page does not exist)&quot;&gt;Onur Aciicmez&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a class=&quot;new&quot; href=&quot;http://en.wikipedia.org/w/index.php?title=Cetin_Kaya_Koc&amp;amp;action=edit&amp;amp;redlink=1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #ba0000; text-decoration: none;&quot; title=&quot;Cetin Kaya Koc (page does not exist)&quot;&gt;Cetin Kaya Koc&lt;/a&gt;) claim to have discovered 508 out of 512 bits of an RSA key in 10 iterations.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;A power fault attack on RSA implementations has been described in 2010.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-13&quot; style=&quot;font-style: normal; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RSA#cite_note-13&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none; white-space: nowrap;&quot;&gt;&lt;span&gt;[&lt;/span&gt;14&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&amp;nbsp;The authors recovered the key by varying the CPU power voltage outside limits; this caused multiple power faults on the server.&lt;/div&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-size: 19px; margin-bottom: 0.6em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=17&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Proofs of correctness&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Proofs_of_correctness&quot;&gt;Proofs of correctness&lt;/span&gt;&lt;/h2&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=18&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Concise proof using Euler&#39;s Theorem&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Concise_proof_using_Euler.27s_Theorem&quot;&gt;Concise proof using Euler&#39;s Theorem&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;To show that a message encrypted with&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;can be decrypted with&amp;nbsp;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;we need to prove&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;img alt=&quot;m \equiv (m^e)^d\text{ (mod }n\text{)}&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/f/0/a/f0a7d6a48d8bf5fbd302f5cc50773fa8.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;i.e.&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;img alt=&quot;m \equiv m^{ed}\text{ (mod }n\text{)}.&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/9/5/5/955d3b2f8593b0f54c12850edecd140d.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Now, since&amp;nbsp;&lt;img alt=&quot;ed = 1 + k\varphi(n)&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/6/d/c/6dcfe285fabba799314404a7aeed5483.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; vertical-align: middle;&quot; /&gt;,&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;img alt=&quot;m^{ed} \equiv m^{1 + k\varphi(n)} \equiv m (m^{\varphi(n)})^{k} \equiv m\text{ (mod }n\text{)}.&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/6/c/d/6cdbfe2e581de2cc5ce097ddaebc639f.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;The last congruence directly follows from&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Euler%27s_theorem&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Euler&#39;s theorem&quot;&gt;Euler&#39;s theorem&lt;/a&gt;&amp;nbsp;when&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;m&lt;/i&gt;&lt;/span&gt;&amp;nbsp;is relatively prime to&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;.&lt;/div&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: initial; border-bottom-style: none; border-bottom-width: initial; color: black; font-size: 17px; font-weight: bold; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0.17em; padding-top: 0.5em; width: auto;&quot;&gt;&lt;span class=&quot;editsection&quot; style=&quot;float: right; font-size: 13px; margin-left: 5px;&quot;&gt;[&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=RSA&amp;amp;action=edit&amp;amp;section=19&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Edit section: Proof using Fermat&#39;s Little Theorem and Chinese Remainder Theorem&quot;&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Proof_using_Fermat.27s_Little_Theorem_and_Chinese_Remainder_Theorem&quot;&gt;Proof using Fermat&#39;s Little Theorem and Chinese Remainder Theorem&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Another way to prove the correctness of RSA is based on&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Fermat%27s_little_theorem&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Fermat&#39;s little theorem&quot;&gt;Fermat&#39;s little theorem&lt;/a&gt;. This theorem states that if&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;is prime and&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;does not divide&lt;i&gt;a&lt;/i&gt;&amp;nbsp;then&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;img alt=&quot; a^{(p-1)} \equiv 1\text{ (mod }p\text{)}.&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/7/e/c/7ec0df7a0c8ed59131b025f8855f6a60.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;In RSA, the modulus&amp;nbsp;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;n&lt;/i&gt;&amp;nbsp;=&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&lt;i&gt;q&lt;/i&gt;&lt;/span&gt;&amp;nbsp;is a product of two primes&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;q&lt;/i&gt;. The public key&amp;nbsp;&lt;i&gt;e&lt;/i&gt;&amp;nbsp;and private key&amp;nbsp;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;satisfy&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;img alt=&quot;e d \equiv 1\text{ (mod }(p-1)(q-1)\text{)}.&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/f/8/9/f89a3c803d5c3f1ee6e2d3a2a8f42eb6.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;Therefore, there exists an integer&amp;nbsp;&lt;i&gt;h&lt;/i&gt;, such that&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;span class=&quot;texhtml&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 1em; white-space: nowrap;&quot;&gt;&lt;i&gt;e&lt;/i&gt;&lt;i&gt;d&lt;/i&gt;&amp;nbsp;− 1 =&amp;nbsp;&lt;i&gt;h&lt;/i&gt;(&lt;i&gt;p&lt;/i&gt;&amp;nbsp;− 1)(&lt;i&gt;q&lt;/i&gt;&amp;nbsp;− 1).&lt;/span&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;We can then continue to calculate&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;img alt=&quot;\left(m^e\right)^d \equiv m^{e d} \equiv m^{(e d - 1)}m \equiv m^{h(p-1)(q-1)}m \equiv 1^{h(q-1)}m\equiv m\text{ (mod }p\text{)}.&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/6/f/e/6fe945e63e00f0a8ca07011dbd81e9a5.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;And likewise for&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;img alt=&quot;\left(m^e\right)^d \equiv m^{e d} \equiv m^{(e d - 1)}m \equiv m^{h(p-1)(q-1)}m \equiv 1^{h(p-1)}m\equiv m\text{ (mod }q\text{)}.&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/d/c/d/dcd2aaef26ca68fabfd3a42ae1147d2a.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;div style=&quot;line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.4em;&quot;&gt;If&amp;nbsp;&lt;i&gt;p&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;q&lt;/i&gt;&amp;nbsp;are coprime,&amp;nbsp;&lt;img alt=&quot;a\equiv b\text{ (mod }p\text{)}&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/f/e/a/fea8e014f500af6c314fb673e0a7153f.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; vertical-align: middle;&quot; /&gt;&amp;nbsp;and&amp;nbsp;&lt;img alt=&quot;a\equiv b\text{ (mod }q\text{)}&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/c/f/7/cf7bc8e6ab189c0551bb8c514563d219.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; vertical-align: middle;&quot; /&gt;&amp;nbsp;then the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Chinese_remainder_theorem&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Chinese remainder theorem&quot;&gt;Chinese remainder theorem&lt;/a&gt;&amp;nbsp;implies&amp;nbsp;&lt;img alt=&quot;a\equiv b\text{ (mod }pq\text{)}&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/1/c/f/1cf51b7fac455548f6f0f5a6ba448cf0.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; vertical-align: middle;&quot; /&gt;. Hence&lt;/div&gt;&lt;dl style=&quot;margin-bottom: 0.5em; margin-top: 0.2em;&quot;&gt;&lt;dd style=&quot;line-height: 1.5em; margin-bottom: 0.1em; margin-left: 1.6em;&quot;&gt;&lt;img alt=&quot;\left(m^e\right)^d \equiv m\text{ (mod }pq\text{)}.&quot; class=&quot;tex&quot; src=&quot;http://upload.wikimedia.org/math/b/2/7/b27e76350e57d73b31d6bef838bb3f84.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; vertical-align: middle;&quot; /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://whatisrsa.blogspot.com/feeds/216278047189237437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://whatisrsa.blogspot.com/2011/09/what-is-rsa.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2596020075800648621/posts/default/216278047189237437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2596020075800648621/posts/default/216278047189237437'/><link rel='alternate' type='text/html' href='http://whatisrsa.blogspot.com/2011/09/what-is-rsa.html' title='What is RSA?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14376640606753915985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>