SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Functionality of the
    RSA cipher



             CrypTool Team
            November 2010
Cryptography and what you need it for

• Sending encrypted messages has always played a major role in the history of humanity.
  In each era there has been important information which had to be kept secret from
  other people.

• Especially in today's society, in the age of internet, it is important to be aware of data security.




                                                     Data reaches their receiver indirectly
                                                     by passing between several servers.

                                                     At each node, the data can be captured,
                                                     read and even changed.




                                            Modern cryptography is about securing this data.

 2
Introductory example: Caesar cipher

• One of the first ways of encrypting a message was the Caesar cipher. The method got
  its name from the ancient emperor Julius Caesar, who used it 2000 years ago to encrypt
  secret messages to his generals.
• Here you can see how it works:




        Plaintext
     This is a secret
      information!




           Write out the alphabet twice in two concentric circles. Offset the letters of
                    the inner circle from the outer one by a certain amount.


 3
Introductory example: Caesar cipher

• One of the first ways of encrypting a message was the Caesar cipher. The method got
  its name from the ancient emperor Julius Caesar, who used it 2000 years ago to encrypt
  secret messages to his generals.
• Here you can see how it works:




        Plaintext                                                             Chipertext
     This is a secret                                                      Wklv kub tfdsfu
                                                                           Vjku lv d vhfuhw
                                                                            Uijt jt c ugetgv
      information!                                                          kphqtocvkqp!
                                                                             jogpsnbujpo!
                                                                              lqirupdwlrq!




           Now each letter in the plaintext will be replaced by its corresponding letter
                     in the inner circle. That’s how you get the ciphertext.


 4
Introductory example: Caesar cipher

• One of the first ways of encrypting a message was the Caesar cipher. The method got
  its name from the ancient emperor Julius Caesar, who used it 2000 years ago to encrypt
  secret messages to his generals.
• Here you can see how it works:




        Plaintext                                                                 Chipertext
     This is a secret                                                          Wklv kub tfdsfu
                                                                               Vjku lv d vhfuhw
                                                                                Uijt jt c ugetgv
      information!                                                              kphqtocvkqp!
                                                                                 jogpsnbujpo!
                                                                                  lqirupdwlrq!




 As there are limited possibilities (only 26 possibilities of different chipertexts),
 this cipher is quite easy to break.


 5
Introductory example: Caesar cipher

• One of the first ways of encrypting a message was the Caesar cipher. The method got
  its name from the ancient emperor Julius Caesar, who used it 2000 years ago to encrypt
  secret messages to his generals.
• Here you can see how it works:




           Plaintext                                                         Chipertext
         This is a secret                                                 Wklv kub tfdsfu
                                                                          Vjku lv d vhfuhw
                                                                           Uijt jt c ugetgv
          information!                                                     kphqtocvkqp!
                                                                            jogpsnbujpo!
                                                                             lqirupdwlrq!




            Do you want to try this cipher on your own text?
     !      You can try it here.


 6
Model of the RSA cipher

• The goal is to achieve a safe means of communication.
  "Safe" in this case means that even if a message is intercepted, it should not be possible
  for an attacker to read the message.
• How can we realize this security? A modern solution is the RSA cipher.
• The idea of the cipher is as follows:




                       Each participant has a padlock with a matching key.


 7
Model of the RSA cipher

• The goal is to achieve a safe means of communication.
  "Safe" in this case means that even if a message is intercepted, it should not be possible
  for an attacker to read the message.
• How can we realize this security? A modern solution is the RSA cipher.
• The idea of the cipher is as follows:




       The main idea is to separate the padlock from the key. You should publicize copies
            of your padlock, as opposed to your key, which you should keep secret.


 8
Model of the RSA cipher

• The goal is to achieve a safe means of communication.
  "Safe" in this case means that even if a message is intercepted, it should not be possible
  for an attacker to read the message.
• How can we realize this security? A modern solution is the RSA cipher.
• The idea of the cipher is as follows:




                     Now someone who wants to send you a message is able
                        to encode his or her message with your padlock.


 9
Model of the RSA cipher

• The goal is to achieve a safe means of communication.
  "Safe" in this case means that even if a message is intercepted, it should not be possible
  for an attacker to read the message.
• How can we realize this security? A modern solution is the RSA cipher.
• The idea of the cipher is as follows:




                Then the message can be sent in public, as only the right recipient
                   will be able to open the padlock with the appropriate key.


 10
The essential problem

• The RSA cipher is the electronic implementation of the model described before.
• The cipher got its name from its inventors: Rivest, Shamir and Adleman.
• The algorithm is based on an underlying mathematical problem. Specifically, it is the problem
  of factoring a given large number into prime numbers.
• When you have a number that is a product of large prime numbers, it is quite hard to find its
  decomposition. Still today no one has found a fast and effective way of finding the factors.
  The security of RSA is based on this difficulty.


3347807169895689878604416984821269081770479498371376856891
2431388982883793878002287614711652531743087737814467999489


                       ∗=    3674604366679959042824463379962795263227915816434308764267
                             6032283815739666511279233373417143396810270092798736308917
                                                             1230186684530117755130494958384962720772853569595334792197

                                                ∗=           3224521517264005072636575187452021997864693899564749427740
                                                             6384592519255732630345373154826850791702612214291346167042
                                                             9214311602221240479274737794080665351419597459856902143413
                                                                      Bit length: 768         Decimal length: 232

           Current PCs can quickly factor numbers with about 80 digits.
      !    Therefore, practical RSA implementations must use moduli with at least 300 digits
           to achieve sufficient security.

 11
How does the RSA cipher work?

To understand how RSA cipher works you need some basic mathematical
concepts. We will explain this in the next slides.

 1   The modulo operator

 2
          ������ ������ = # ������ ������ ℕ ������������������ ������, ������ = 1, 1 < ������ < ������}
     Euler‘s totient function

 3
          ������ ������ = # ������ ������ ℕ ������������������ ������, ������ = 1, 1 < ������ < ������}
     Euler-Fermat theorem




12
Mathematical basics - 1

The modulo operator
• This sign is the modulo operator. With the modulo operation you are
  interested in the remainder left over from division with an integer number.
• To get a better idea, take a look at the following:




                                                         16 ≡ 1 ������������������ 5

              Five people want to share a cake which is already cut into 16 pieces.
               Each of them can get three pieces of cake, but one will be left over.
                    The modulo operator calculates precisely this remainder.

 13
Mathematical basics - 1

The modulo operator
• This sign is the modulo operator. With the modulo operation you are
  interested in the remainder left over from division with an integer number.
• To get a better idea, take a look at the following:




Mathematical definition                                  An example
                                                         The modulo operator is commutative with the basic
                ������ ≡ ������ ������������������ ������                        arithmetic operations. For example it does not matter
means that there exists an integer number ������ ∗ ������ + ������
                                     ������ = such           whether you first multiply
that ������ can������ ������������������ ������
        ≡ be represented as                                          18 ∗ 13 = 234 ≡ 4 ������������������ 10
              ������ = ������ ∗ ������ + ������                          or first calculate the modulus and then multiply:

with the condition that: 0 ≤ ������ ≤ ������ − 1                              18 ∗ 13 ≡ 8 ∗ 3 ������������������ 10
                                                                    = 24 ������������������ 10 ≡ 4 ������������������ 10


          We are not interested in the value of ������.∗ ������ + ������
                                            ������ =                   Further information can be found in the
      !   The important part is its existence.                 ?   CrypTool Script (chap. 4.4).


 14
Mathematical basics - 2

Euler’s totient function
• Euler’s totient function ������ of an integerℕ counts ������ ������ ℕ= ������������������< ������������ ������} 1 ������������������ both coprime
                              ������ = # ������������ ������ ������������������ ������, ������ many1 ������, < =
                                         ������   = # how 1, whole numbers are 1 < ������ < ������}
  to ������ and# ������ ������ ℕ than������ . = # = ������ ℕ ������������������< ������������ = 1 ������������������ 1 < ������ < ������}
  ������     = smaller ������������������ ������, ������ ������ 1 ������������������ 1 ������, < ������}
                       ������
• Here how the formula looks:


              ������ ������ = # ������ ������ ℕ ������������������ ������, ������ = 1 ������������������ 1 ≤ ������ < ������}                                 ?

Important properties                                     Example
Given a number which is product of two factors           Suppose we want to calculate ������ 10 .= #{1,3,7,9} = 4
 ������ and ������ :                                             First we find the factor of 10 := 5 ∗ 2
          ������ ������ ∗ ������ = ������ ������ ∗ ������ ������
                                                                              10 = 5 ∗ 2
Given a prime number ������ :                                Becauseo 5 ∗5 ∗ 2 are primes, we can use
                                                             10 10 =and
                                                                =     2
                ������ ������ = ������ − 1                           the formula given to the left:
                                                                  ������ 10 = ������ 5 ∗ ������ 2 = 4 ∗ 1 = 4
Therefore , given a number composed of two
primes, ������ == ∗ ������������ ������ ℕ ������������������ ������, ������ = 1 ������������������ 1 < ������ < ������}
     ������ ������ ������ # :                                                                         ������ 2 = #{1} = 1
                                                             ������ 5 = #{1, 2, 3, 4} = 4
������ ������ = ������ ������ ∗ ������ = ������ ������ ∗ ������ ������ = ������ − 1 (������ − 1)         ������ 10 = #{1, 3, 7, 9} = 4


 15                                                                       Näheres siehe CrypTool-Skript, Kap 4.8.2
Mathematical basics - 3

          The Euler-Fermat theorem
          • The last basic equation is the Euler-Fermat theorem.


                 ������������(������) = 1 ������������������ ������ , wenn ������������������(������, and = :1= 1
                      Given two coprime numbers������������������(������, ������)
                                                          ������)
                                       ������������(������) ≡ 1 ������������������ ������ ,


          Modulus calculations operate in the                      0                                The cycles generated by
                                                           9                1
          finite set {0, 1, … , ������ − 1} .                                                   this operation both have length 4
          A function is called cyclic if, after                                                     , which is exactly ������ ������ + 1
                                                                                                                              .
          repeated application, the results
                                                       8                        2
4        2
    =       ∗ 72 = 49 ∗ within 9 set.
        7 repeat themselves 49 ≡this∗ 9 =         81 ≡ 1 ������������������ 10                  If you multiply a number ������ = 3
                                                                                                                 by itself, you
                                                       7       ������ = 3           3       will, with absolute certainty, reach ������ = 3
                                                                                                                               .
          For example, one such cyclic function                ������ = 7                             again in at most ������ ������ steps.
                                                                                                                         +1
          is multiplication with a fixed base.
                                                           6                4          You can verify this by multiplying both
          We will choose the numbers ������ = 3 and                    5                         sides of the formula above by ������ .= 3
          ������ = 7 as the fixed bases. We can multiply
          each number by itself until we reach it
          again. In our example ������ = 10
                                                           3   9   7    1   3   With these basic equations we can
          with ������ ������ = 4 .                                 7   9   3    1   7    start looking at the actual cipher.

           16
Step 1: Generate the keys

• We separate the RSA cipher algorithm into three different steps which will be explained
  on the following slides.
• First we have to generate our RSA keys. This step must be done only once as an initial step.
Formal                                                    Example
1.
1     Choose two primes ������ and ������ with ������ ≠ ������             1.
                                                           1     Suppose we select ������ = 13=and 7 = 7
                                                                                        ������ ������ = ������
                                                                                            13

2.
2     Calculate their product: ������ = ������ ∗ ������                2.
                                                           2     Thus: ������ = 13 ∗ 7 = 91

3.
3     Calculate the value of Euler’s totient               3      ������ 91 = ������ 13 ∗ 7 = 13 − 1 (7 − 1) = 72
      function of ������
                                                           3.
                                                           4     Suppose we choose ������ = 5, because:
          ������ ������ = ������ ������ ∗ ������ = ������ − 1 (������ − 1)
                                                                 ������������������ 5, 72 = 1
4.
4     Choose a number ������ between 1 and ������ − 1               4.   We will select ������ = 29 as thus:
                                                           5
      which is coprime to ������ ������ = ������ ������ ∗ ������ = ������ − 1 (������ − 1)
                                                                  ������ ∗ ������ = 145 = 2 ∗ 72 + 1 ≡ 1 ������������������ 72
5.
5     Find another number ������ ∗ ������ ≡ 1 ������������������ ������ ������
                             where                                      Here you can get more information on
                                                                   ?
                                                                        how to find an appropiate number ������ = 29
              ������ ∗ ������ ≡ 1 ������������������ ������ ������
                                                                        (by means of the extended Euclidean algorithm)

 (������, ������) is the public RSA key.
 (������, ������) is the private key.


 17                                                     You can find further details in the CrypTool script, chap. 4.10.3
Step 2: Encrypt messages

• Now we have the requirements to encrypt and decrypt messages.
• First we must convert the letters into numbers to be able to use them in our calculations.


   For example you can use the following substitution:
      A     B       C      D     …     Z
      01   02       03     04    …     26



Formal                                                     Example
To encrypt a message we have to calculate                  We shall continue our example by encoding
                                                           the word “SECRET”:
                ������ ≡ ������ ������ ������������������ ������
                                                                 Letters   S    E   C   R   E   T
Here ������ is the converted message������ ������ ������ is the
                                  and                          Numbers     19 05 03 18 05 20
encoded text, the ciphertext. The numbers ������ ������ ������ ������ ������
                                                ������
                                              and
are taken from the public RSA key.                         Now we take the first letter S = 19 and encrypt
                                                           it by using the public key: (5, 91)
                                                            ������ ������ = 195 = 19 ∗ 192 2 = 19 ∗ 361 2
                                                            ≡ 19 ∗ (88)2 ≡ 19 ∗ 9 = 171 = 80 ������������������ 91
           The presented cipher is simplified.
                                                           Following this pattern, ”SECRET“ is encrypted as
      !    Further information is provided in the
                                                           follows:
           next slides.                                                     80 31 61 44 31 76



 18
Step 3: Decrypt Messages

• The receiver gets the message now in its encrypted form only.

Formal                                                     Example
To decipher the original message the receiver              The encrypted message is as follows:
needs to calculate the following:                                          30 31 61 44 31 76
               ������ ≡ ������ ������ ������������������ ������
Here ������ will produce the plaintext. The values(������, ������)     According to the formula given to left, he or she can
and ������ are saved in the receiver’s private key (������, ������).
  ������ ������                                                    decipher by using his or her private key (29, 91) :

                                                                  ������ ������ = 3029 = ⋯ ≡ 19 ������������������ 91
                                                           The complete plaintext is obtained by calculating
                                                           accordingly for each value.

                                                              Nnumbers     19 05 03 18 05 20
                                                                 Letters    S   E   C   R    E    T




           Why do you get the plaintext by using these formulas?
      ?    You can learn the answer on the following slides.


 19
Explanation of the formulas

• The following formulas explain why the receiver will obtain the plaintext from
  the encrypted text.
• First we should examine the process of decryption more precisely.
  Since ������ = ������ ������,

                                        ������ ������ = (������ ������ )������ = ������ ������∗������

• Thus ������ ∗ ������ ≡ 1 ������������������ ������ ������ , which is equivalent to ������ ∗ ������ = 1 + ������ ∗ ������(������), = 1 + ������ ∗ ������(������)
                 .                                                           ������ ∗ ������ where is an
  arbitrary integer number.
• We can then derive the following sequence of equations:

                   ������ ������∗������ = ������ 1+������∗������ ������ = ������ ∗ ������ ������∗������ ������ = ������ ∗ (������ ������ ������ )������
• By means of Euler-Fermat theorem, ������ ������ ������ ≡ 1 ������������������ ������, we get:
                                     ������ ∗ (������ ������ ������ )������ ≡ ������ ������������������ ������
• All in all we get the following:

              ������                     By raising the ciphertext to a higher power,
           ������ ≡ ������ ������������������ ������         we reobtain the plaintext.



 20
Security of the cipher

• The given example was simplified to make the explanation clearer. If you were to use
  the cipher as it was just explained, communication would be insecure.

      S     E      C   R     E      T   By encoding each letter to one number, the resulting encryption will
  19 05 03 18 05 20
                                        be a one-to-one mapping: for each letter there is just one corresponding
                                        number in the ciphertext.
  30 31 61 44 31 76                     So an easy way of attacking the ciphertext is by using a frequency analysis.
                                        The idea is that there exists an unequal distribution of letters in each
      .     E      .   .     E      .
                                        language. In English the most frequent letter is the letter “E”, so you can
                                        try to replace the most frequent number in the ciphertext with “E”.


• To avoid this problem, a possible solution is to combine several numbers into a block.
  In our example we could unite it as follows an then encode it again in another manner:

           SEC              RET                   By combining several numbers to a block, we have to pay
          190503           180520           !     attention in choosing our module ������. ������ has to be bigger than
                                                                                  ������ It
                                                  the largest possible number in the block.

• In practice, RSA is not used to encrypt text blocks, but rather combined with a symmetric
  cipher. In this case, RSA is only used to encrypt the key of the symmetric cipher
  (Hybrid cryptosystem).

 21
The factorization problem and RSA

• You may be asking yourself why all of this is based on the problem of factoring large numbers.
• We will explain this with the help of our example, as it is easy to find the factors of the number ������: = 91
                                        ������ = 91 = 13 ∗ 7 = ������ ∗ ������

• As soon as you have the factorization, you can calculate ������ ������ . By means of ������ ������ ������ the connection
                                                                                            and
  of ������ = 29 ������ ������ ������ the formula ������ ∗ ������ ≡ 1 ������������������ ������ ������ , you can easily find the number ������, = 29 is
        and with                                                                                which
  ‒ together with ������ ‒ the private ∗ 7 Once you have the private key you can decrypt the entire
                         = 91 = 13 key.
  ciphertext.
• No one has yet found a way to:
  • calculate ������ with the ������������������of ������ without knowing the factorization of the number ������. = 91 = 13 ∗ 7
                  ∗ ������ ≡ 1 help ������ ������ ������
                                      ������
  • calculate the plaintext from the cipher without knowing the private key ������ .∗ ������ ≡ 1 ������������������ ������ ������




          In fact, by knowing the factorization and the public key (������, ������) it is possible to
      !   generate the private key. Therefore, the attacker could repeat the first step
          of the process, the generation of the keys.


 22
Further information and references

• http://www.cryptool.org
  An open-source software tool for learning cryptographic ciphers and cryptanalysis

• http://cryptool.org/download/CrypToolScript-en.pdf
  A thorough script with more information about the mathematical aspects of cryptography

• http://en.wikipedia.org/wiki/Cryptography
  Wikipedia article about cryptography in general

• http://en.wikipedia.org/wiki/RSA_cipher
  Wikipedia article about the RSA cipher

• http://www.gax.nl/wiskundePO/
  Online RSA encryption application (Dutch)




 23

Weitere ähnliche Inhalte

Andere mochten auch

Shoreline Church
Shoreline ChurchShoreline Church
Shoreline ChurchJason Hayes
 
Lc english (1)
Lc   english (1)Lc   english (1)
Lc english (1)Kath Lin
 
Monobeso. capítol 4. l'expulsió del paradís
Monobeso. capítol 4. l'expulsió del paradísMonobeso. capítol 4. l'expulsió del paradís
Monobeso. capítol 4. l'expulsió del paradísAleix Bascompte Vilardebo
 
Tablet Friendly Web Design - Best Practices for Financial Services
Tablet Friendly Web Design - Best Practices for Financial ServicesTablet Friendly Web Design - Best Practices for Financial Services
Tablet Friendly Web Design - Best Practices for Financial ServicesCorporate Insight
 
페이스북개발 트렌드 130313
페이스북개발 트렌드 130313페이스북개발 트렌드 130313
페이스북개발 트렌드 130313Seong Whan Park
 
Pakistan CIO Summit and Expo 2013-Post Event Presentation
Pakistan CIO Summit and Expo 2013-Post Event PresentationPakistan CIO Summit and Expo 2013-Post Event Presentation
Pakistan CIO Summit and Expo 2013-Post Event PresentationSolutions Inc Pakistan
 
Cpu portfolio global-uk-maio2013-lr
Cpu portfolio global-uk-maio2013-lrCpu portfolio global-uk-maio2013-lr
Cpu portfolio global-uk-maio2013-lrJoão Pedro Ribeiro
 
2015 Live the Lifestyle of your Dreams
2015 Live the Lifestyle of your Dreams2015 Live the Lifestyle of your Dreams
2015 Live the Lifestyle of your DreamsCindy McAsey
 
FAQ Immense Lab www.immenselab.com
FAQ Immense Lab www.immenselab.comFAQ Immense Lab www.immenselab.com
FAQ Immense Lab www.immenselab.comImmense Lab
 
EECU Credit Union 2013 Annual Report
EECU Credit Union 2013 Annual ReportEECU Credit Union 2013 Annual Report
EECU Credit Union 2013 Annual Reportclaytonroot
 
Papagalite ot martin-chakarov
Papagalite ot martin-chakarovPapagalite ot martin-chakarov
Papagalite ot martin-chakarovmartotopicha
 
Fundamental Techniques of Communication
Fundamental Techniques of CommunicationFundamental Techniques of Communication
Fundamental Techniques of CommunicationCindy McAsey
 

Andere mochten auch (14)

Shoreline Church
Shoreline ChurchShoreline Church
Shoreline Church
 
Lc english (1)
Lc   english (1)Lc   english (1)
Lc english (1)
 
Monobeso. capítol 4. l'expulsió del paradís
Monobeso. capítol 4. l'expulsió del paradísMonobeso. capítol 4. l'expulsió del paradís
Monobeso. capítol 4. l'expulsió del paradís
 
Smla 2011
Smla 2011Smla 2011
Smla 2011
 
Tablet Friendly Web Design - Best Practices for Financial Services
Tablet Friendly Web Design - Best Practices for Financial ServicesTablet Friendly Web Design - Best Practices for Financial Services
Tablet Friendly Web Design - Best Practices for Financial Services
 
페이스북개발 트렌드 130313
페이스북개발 트렌드 130313페이스북개발 트렌드 130313
페이스북개발 트렌드 130313
 
Pakistan CIO Summit and Expo 2013-Post Event Presentation
Pakistan CIO Summit and Expo 2013-Post Event PresentationPakistan CIO Summit and Expo 2013-Post Event Presentation
Pakistan CIO Summit and Expo 2013-Post Event Presentation
 
Cpu portfolio global-uk-maio2013-lr
Cpu portfolio global-uk-maio2013-lrCpu portfolio global-uk-maio2013-lr
Cpu portfolio global-uk-maio2013-lr
 
2015 Live the Lifestyle of your Dreams
2015 Live the Lifestyle of your Dreams2015 Live the Lifestyle of your Dreams
2015 Live the Lifestyle of your Dreams
 
FAQ Immense Lab www.immenselab.com
FAQ Immense Lab www.immenselab.comFAQ Immense Lab www.immenselab.com
FAQ Immense Lab www.immenselab.com
 
CUBITOS PARA JUGAR
CUBITOS PARA JUGARCUBITOS PARA JUGAR
CUBITOS PARA JUGAR
 
EECU Credit Union 2013 Annual Report
EECU Credit Union 2013 Annual ReportEECU Credit Union 2013 Annual Report
EECU Credit Union 2013 Annual Report
 
Papagalite ot martin-chakarov
Papagalite ot martin-chakarovPapagalite ot martin-chakarov
Papagalite ot martin-chakarov
 
Fundamental Techniques of Communication
Fundamental Techniques of CommunicationFundamental Techniques of Communication
Fundamental Techniques of Communication
 

Ähnlich wie Functionality of the RSA Cipher

Dark Side of the Net Lecture 2 Cryptography
Dark Side of the Net Lecture 2 CryptographyDark Side of the Net Lecture 2 Cryptography
Dark Side of the Net Lecture 2 CryptographyMarcus Leaning
 
Introduction to cryptography part2-final
Introduction to cryptography  part2-finalIntroduction to cryptography  part2-final
Introduction to cryptography part2-finalTaymoor Nazmy
 
Cryptography and E-Commerce
Cryptography and E-CommerceCryptography and E-Commerce
Cryptography and E-CommerceHiep Luong
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniquesbabak danyal
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Securitybabak danyal
 
Introduction to cryptography part1-final
Introduction to cryptography  part1-finalIntroduction to cryptography  part1-final
Introduction to cryptography part1-finalTaymoor Nazmy
 
Cs166 mynote
Cs166 mynoteCs166 mynote
Cs166 mynoteKaya Ota
 
Cryptography and Network Security
Cryptography and Network SecurityCryptography and Network Security
Cryptography and Network SecurityPa Van Tanku
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.pptGhamdan5
 
the art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.pptthe art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.pptjamkhan10
 
This is the presentation ofcryptography.ppt
This is the presentation ofcryptography.pptThis is the presentation ofcryptography.ppt
This is the presentation ofcryptography.pptvimalguptaofficial
 

Ähnlich wie Functionality of the RSA Cipher (20)

Dark Side of the Net Lecture 2 Cryptography
Dark Side of the Net Lecture 2 CryptographyDark Side of the Net Lecture 2 Cryptography
Dark Side of the Net Lecture 2 Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Introduction to cryptography part2-final
Introduction to cryptography  part2-finalIntroduction to cryptography  part2-final
Introduction to cryptography part2-final
 
Cryptography using python
Cryptography using pythonCryptography using python
Cryptography using python
 
Cryptography and E-Commerce
Cryptography and E-CommerceCryptography and E-Commerce
Cryptography and E-Commerce
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 
Introduction to cryptography part1-final
Introduction to cryptography  part1-finalIntroduction to cryptography  part1-final
Introduction to cryptography part1-final
 
Unit – III.pptx
Unit – III.pptxUnit – III.pptx
Unit – III.pptx
 
Cryptography
Cryptography Cryptography
Cryptography
 
Cs166 mynote
Cs166 mynoteCs166 mynote
Cs166 mynote
 
Cryptography and Network Security
Cryptography and Network SecurityCryptography and Network Security
Cryptography and Network Security
 
Cryptography
CryptographyCryptography
Cryptography
 
Code and cipher
Code and cipherCode and cipher
Code and cipher
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
 
the art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.pptthe art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.ppt
 
This is the presentation ofcryptography.ppt
This is the presentation ofcryptography.pptThis is the presentation ofcryptography.ppt
This is the presentation ofcryptography.ppt
 
7 cryptography
7 cryptography7 cryptography
7 cryptography
 

Kürzlich hochgeladen

Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Kürzlich hochgeladen (20)

Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Functionality of the RSA Cipher

  • 1. Functionality of the RSA cipher CrypTool Team November 2010
  • 2. Cryptography and what you need it for • Sending encrypted messages has always played a major role in the history of humanity. In each era there has been important information which had to be kept secret from other people. • Especially in today's society, in the age of internet, it is important to be aware of data security. Data reaches their receiver indirectly by passing between several servers. At each node, the data can be captured, read and even changed. Modern cryptography is about securing this data. 2
  • 3. Introductory example: Caesar cipher • One of the first ways of encrypting a message was the Caesar cipher. The method got its name from the ancient emperor Julius Caesar, who used it 2000 years ago to encrypt secret messages to his generals. • Here you can see how it works: Plaintext This is a secret information! Write out the alphabet twice in two concentric circles. Offset the letters of the inner circle from the outer one by a certain amount. 3
  • 4. Introductory example: Caesar cipher • One of the first ways of encrypting a message was the Caesar cipher. The method got its name from the ancient emperor Julius Caesar, who used it 2000 years ago to encrypt secret messages to his generals. • Here you can see how it works: Plaintext Chipertext This is a secret Wklv kub tfdsfu Vjku lv d vhfuhw Uijt jt c ugetgv information! kphqtocvkqp! jogpsnbujpo! lqirupdwlrq! Now each letter in the plaintext will be replaced by its corresponding letter in the inner circle. That’s how you get the ciphertext. 4
  • 5. Introductory example: Caesar cipher • One of the first ways of encrypting a message was the Caesar cipher. The method got its name from the ancient emperor Julius Caesar, who used it 2000 years ago to encrypt secret messages to his generals. • Here you can see how it works: Plaintext Chipertext This is a secret Wklv kub tfdsfu Vjku lv d vhfuhw Uijt jt c ugetgv information! kphqtocvkqp! jogpsnbujpo! lqirupdwlrq! As there are limited possibilities (only 26 possibilities of different chipertexts), this cipher is quite easy to break. 5
  • 6. Introductory example: Caesar cipher • One of the first ways of encrypting a message was the Caesar cipher. The method got its name from the ancient emperor Julius Caesar, who used it 2000 years ago to encrypt secret messages to his generals. • Here you can see how it works: Plaintext Chipertext This is a secret Wklv kub tfdsfu Vjku lv d vhfuhw Uijt jt c ugetgv information! kphqtocvkqp! jogpsnbujpo! lqirupdwlrq! Do you want to try this cipher on your own text? ! You can try it here. 6
  • 7. Model of the RSA cipher • The goal is to achieve a safe means of communication. "Safe" in this case means that even if a message is intercepted, it should not be possible for an attacker to read the message. • How can we realize this security? A modern solution is the RSA cipher. • The idea of the cipher is as follows: Each participant has a padlock with a matching key. 7
  • 8. Model of the RSA cipher • The goal is to achieve a safe means of communication. "Safe" in this case means that even if a message is intercepted, it should not be possible for an attacker to read the message. • How can we realize this security? A modern solution is the RSA cipher. • The idea of the cipher is as follows: The main idea is to separate the padlock from the key. You should publicize copies of your padlock, as opposed to your key, which you should keep secret. 8
  • 9. Model of the RSA cipher • The goal is to achieve a safe means of communication. "Safe" in this case means that even if a message is intercepted, it should not be possible for an attacker to read the message. • How can we realize this security? A modern solution is the RSA cipher. • The idea of the cipher is as follows: Now someone who wants to send you a message is able to encode his or her message with your padlock. 9
  • 10. Model of the RSA cipher • The goal is to achieve a safe means of communication. "Safe" in this case means that even if a message is intercepted, it should not be possible for an attacker to read the message. • How can we realize this security? A modern solution is the RSA cipher. • The idea of the cipher is as follows: Then the message can be sent in public, as only the right recipient will be able to open the padlock with the appropriate key. 10
  • 11. The essential problem • The RSA cipher is the electronic implementation of the model described before. • The cipher got its name from its inventors: Rivest, Shamir and Adleman. • The algorithm is based on an underlying mathematical problem. Specifically, it is the problem of factoring a given large number into prime numbers. • When you have a number that is a product of large prime numbers, it is quite hard to find its decomposition. Still today no one has found a fast and effective way of finding the factors. The security of RSA is based on this difficulty. 3347807169895689878604416984821269081770479498371376856891 2431388982883793878002287614711652531743087737814467999489 ∗= 3674604366679959042824463379962795263227915816434308764267 6032283815739666511279233373417143396810270092798736308917 1230186684530117755130494958384962720772853569595334792197 ∗= 3224521517264005072636575187452021997864693899564749427740 6384592519255732630345373154826850791702612214291346167042 9214311602221240479274737794080665351419597459856902143413 Bit length: 768 Decimal length: 232 Current PCs can quickly factor numbers with about 80 digits. ! Therefore, practical RSA implementations must use moduli with at least 300 digits to achieve sufficient security. 11
  • 12. How does the RSA cipher work? To understand how RSA cipher works you need some basic mathematical concepts. We will explain this in the next slides. 1 The modulo operator 2 ������ ������ = # ������ ������ ℕ ������������������ ������, ������ = 1, 1 < ������ < ������} Euler‘s totient function 3 ������ ������ = # ������ ������ ℕ ������������������ ������, ������ = 1, 1 < ������ < ������} Euler-Fermat theorem 12
  • 13. Mathematical basics - 1 The modulo operator • This sign is the modulo operator. With the modulo operation you are interested in the remainder left over from division with an integer number. • To get a better idea, take a look at the following: 16 ≡ 1 ������������������ 5 Five people want to share a cake which is already cut into 16 pieces. Each of them can get three pieces of cake, but one will be left over. The modulo operator calculates precisely this remainder. 13
  • 14. Mathematical basics - 1 The modulo operator • This sign is the modulo operator. With the modulo operation you are interested in the remainder left over from division with an integer number. • To get a better idea, take a look at the following: Mathematical definition An example The modulo operator is commutative with the basic ������ ≡ ������ ������������������ ������ arithmetic operations. For example it does not matter means that there exists an integer number ������ ∗ ������ + ������ ������ = such whether you first multiply that ������ can������ ������������������ ������ ≡ be represented as 18 ∗ 13 = 234 ≡ 4 ������������������ 10 ������ = ������ ∗ ������ + ������ or first calculate the modulus and then multiply: with the condition that: 0 ≤ ������ ≤ ������ − 1 18 ∗ 13 ≡ 8 ∗ 3 ������������������ 10 = 24 ������������������ 10 ≡ 4 ������������������ 10 We are not interested in the value of ������.∗ ������ + ������ ������ = Further information can be found in the ! The important part is its existence. ? CrypTool Script (chap. 4.4). 14
  • 15. Mathematical basics - 2 Euler’s totient function • Euler’s totient function ������ of an integerℕ counts ������ ������ ℕ= ������������������< ������������ ������} 1 ������������������ both coprime ������ = # ������������ ������ ������������������ ������, ������ many1 ������, < = ������ = # how 1, whole numbers are 1 < ������ < ������} to ������ and# ������ ������ ℕ than������ . = # = ������ ℕ ������������������< ������������ = 1 ������������������ 1 < ������ < ������} ������ = smaller ������������������ ������, ������ ������ 1 ������������������ 1 ������, < ������} ������ • Here how the formula looks: ������ ������ = # ������ ������ ℕ ������������������ ������, ������ = 1 ������������������ 1 ≤ ������ < ������} ? Important properties Example Given a number which is product of two factors Suppose we want to calculate ������ 10 .= #{1,3,7,9} = 4 ������ and ������ : First we find the factor of 10 := 5 ∗ 2 ������ ������ ∗ ������ = ������ ������ ∗ ������ ������ 10 = 5 ∗ 2 Given a prime number ������ : Becauseo 5 ∗5 ∗ 2 are primes, we can use 10 10 =and = 2 ������ ������ = ������ − 1 the formula given to the left: ������ 10 = ������ 5 ∗ ������ 2 = 4 ∗ 1 = 4 Therefore , given a number composed of two primes, ������ == ∗ ������������ ������ ℕ ������������������ ������, ������ = 1 ������������������ 1 < ������ < ������} ������ ������ ������ # : ������ 2 = #{1} = 1 ������ 5 = #{1, 2, 3, 4} = 4 ������ ������ = ������ ������ ∗ ������ = ������ ������ ∗ ������ ������ = ������ − 1 (������ − 1) ������ 10 = #{1, 3, 7, 9} = 4 15 Näheres siehe CrypTool-Skript, Kap 4.8.2
  • 16. Mathematical basics - 3 The Euler-Fermat theorem • The last basic equation is the Euler-Fermat theorem. ������������(������) = 1 ������������������ ������ , wenn ������������������(������, and = :1= 1 Given two coprime numbers������������������(������, ������) ������) ������������(������) ≡ 1 ������������������ ������ , Modulus calculations operate in the 0 The cycles generated by 9 1 finite set {0, 1, … , ������ − 1} . this operation both have length 4 A function is called cyclic if, after , which is exactly ������ ������ + 1 . repeated application, the results 8 2 4 2 = ∗ 72 = 49 ∗ within 9 set. 7 repeat themselves 49 ≡this∗ 9 = 81 ≡ 1 ������������������ 10 If you multiply a number ������ = 3 by itself, you 7 ������ = 3 3 will, with absolute certainty, reach ������ = 3 . For example, one such cyclic function ������ = 7 again in at most ������ ������ steps. +1 is multiplication with a fixed base. 6 4 You can verify this by multiplying both We will choose the numbers ������ = 3 and 5 sides of the formula above by ������ .= 3 ������ = 7 as the fixed bases. We can multiply each number by itself until we reach it again. In our example ������ = 10 3 9 7 1 3 With these basic equations we can with ������ ������ = 4 . 7 9 3 1 7 start looking at the actual cipher. 16
  • 17. Step 1: Generate the keys • We separate the RSA cipher algorithm into three different steps which will be explained on the following slides. • First we have to generate our RSA keys. This step must be done only once as an initial step. Formal Example 1. 1 Choose two primes ������ and ������ with ������ ≠ ������ 1. 1 Suppose we select ������ = 13=and 7 = 7 ������ ������ = ������ 13 2. 2 Calculate their product: ������ = ������ ∗ ������ 2. 2 Thus: ������ = 13 ∗ 7 = 91 3. 3 Calculate the value of Euler’s totient 3 ������ 91 = ������ 13 ∗ 7 = 13 − 1 (7 − 1) = 72 function of ������ 3. 4 Suppose we choose ������ = 5, because: ������ ������ = ������ ������ ∗ ������ = ������ − 1 (������ − 1) ������������������ 5, 72 = 1 4. 4 Choose a number ������ between 1 and ������ − 1 4. We will select ������ = 29 as thus: 5 which is coprime to ������ ������ = ������ ������ ∗ ������ = ������ − 1 (������ − 1) ������ ∗ ������ = 145 = 2 ∗ 72 + 1 ≡ 1 ������������������ 72 5. 5 Find another number ������ ∗ ������ ≡ 1 ������������������ ������ ������ where Here you can get more information on ? how to find an appropiate number ������ = 29 ������ ∗ ������ ≡ 1 ������������������ ������ ������ (by means of the extended Euclidean algorithm) (������, ������) is the public RSA key. (������, ������) is the private key. 17 You can find further details in the CrypTool script, chap. 4.10.3
  • 18. Step 2: Encrypt messages • Now we have the requirements to encrypt and decrypt messages. • First we must convert the letters into numbers to be able to use them in our calculations. For example you can use the following substitution: A B C D … Z 01 02 03 04 … 26 Formal Example To encrypt a message we have to calculate We shall continue our example by encoding the word “SECRET”: ������ ≡ ������ ������ ������������������ ������ Letters S E C R E T Here ������ is the converted message������ ������ ������ is the and Numbers 19 05 03 18 05 20 encoded text, the ciphertext. The numbers ������ ������ ������ ������ ������ ������ and are taken from the public RSA key. Now we take the first letter S = 19 and encrypt it by using the public key: (5, 91) ������ ������ = 195 = 19 ∗ 192 2 = 19 ∗ 361 2 ≡ 19 ∗ (88)2 ≡ 19 ∗ 9 = 171 = 80 ������������������ 91 The presented cipher is simplified. Following this pattern, ”SECRET“ is encrypted as ! Further information is provided in the follows: next slides. 80 31 61 44 31 76 18
  • 19. Step 3: Decrypt Messages • The receiver gets the message now in its encrypted form only. Formal Example To decipher the original message the receiver The encrypted message is as follows: needs to calculate the following: 30 31 61 44 31 76 ������ ≡ ������ ������ ������������������ ������ Here ������ will produce the plaintext. The values(������, ������) According to the formula given to left, he or she can and ������ are saved in the receiver’s private key (������, ������). ������ ������ decipher by using his or her private key (29, 91) : ������ ������ = 3029 = ⋯ ≡ 19 ������������������ 91 The complete plaintext is obtained by calculating accordingly for each value. Nnumbers 19 05 03 18 05 20 Letters S E C R E T Why do you get the plaintext by using these formulas? ? You can learn the answer on the following slides. 19
  • 20. Explanation of the formulas • The following formulas explain why the receiver will obtain the plaintext from the encrypted text. • First we should examine the process of decryption more precisely. Since ������ = ������ ������, ������ ������ = (������ ������ )������ = ������ ������∗������ • Thus ������ ∗ ������ ≡ 1 ������������������ ������ ������ , which is equivalent to ������ ∗ ������ = 1 + ������ ∗ ������(������), = 1 + ������ ∗ ������(������) . ������ ∗ ������ where is an arbitrary integer number. • We can then derive the following sequence of equations: ������ ������∗������ = ������ 1+������∗������ ������ = ������ ∗ ������ ������∗������ ������ = ������ ∗ (������ ������ ������ )������ • By means of Euler-Fermat theorem, ������ ������ ������ ≡ 1 ������������������ ������, we get: ������ ∗ (������ ������ ������ )������ ≡ ������ ������������������ ������ • All in all we get the following: ������ By raising the ciphertext to a higher power, ������ ≡ ������ ������������������ ������ we reobtain the plaintext. 20
  • 21. Security of the cipher • The given example was simplified to make the explanation clearer. If you were to use the cipher as it was just explained, communication would be insecure. S E C R E T By encoding each letter to one number, the resulting encryption will 19 05 03 18 05 20 be a one-to-one mapping: for each letter there is just one corresponding number in the ciphertext. 30 31 61 44 31 76 So an easy way of attacking the ciphertext is by using a frequency analysis. The idea is that there exists an unequal distribution of letters in each . E . . E . language. In English the most frequent letter is the letter “E”, so you can try to replace the most frequent number in the ciphertext with “E”. • To avoid this problem, a possible solution is to combine several numbers into a block. In our example we could unite it as follows an then encode it again in another manner: SEC RET By combining several numbers to a block, we have to pay 190503 180520 ! attention in choosing our module ������. ������ has to be bigger than ������ It the largest possible number in the block. • In practice, RSA is not used to encrypt text blocks, but rather combined with a symmetric cipher. In this case, RSA is only used to encrypt the key of the symmetric cipher (Hybrid cryptosystem). 21
  • 22. The factorization problem and RSA • You may be asking yourself why all of this is based on the problem of factoring large numbers. • We will explain this with the help of our example, as it is easy to find the factors of the number ������: = 91 ������ = 91 = 13 ∗ 7 = ������ ∗ ������ • As soon as you have the factorization, you can calculate ������ ������ . By means of ������ ������ ������ the connection and of ������ = 29 ������ ������ ������ the formula ������ ∗ ������ ≡ 1 ������������������ ������ ������ , you can easily find the number ������, = 29 is and with which ‒ together with ������ ‒ the private ∗ 7 Once you have the private key you can decrypt the entire = 91 = 13 key. ciphertext. • No one has yet found a way to: • calculate ������ with the ������������������of ������ without knowing the factorization of the number ������. = 91 = 13 ∗ 7 ∗ ������ ≡ 1 help ������ ������ ������ ������ • calculate the plaintext from the cipher without knowing the private key ������ .∗ ������ ≡ 1 ������������������ ������ ������ In fact, by knowing the factorization and the public key (������, ������) it is possible to ! generate the private key. Therefore, the attacker could repeat the first step of the process, the generation of the keys. 22
  • 23. Further information and references • http://www.cryptool.org An open-source software tool for learning cryptographic ciphers and cryptanalysis • http://cryptool.org/download/CrypToolScript-en.pdf A thorough script with more information about the mathematical aspects of cryptography • http://en.wikipedia.org/wiki/Cryptography Wikipedia article about cryptography in general • http://en.wikipedia.org/wiki/RSA_cipher Wikipedia article about the RSA cipher • http://www.gax.nl/wiskundePO/ Online RSA encryption application (Dutch) 23

Hinweis der Redaktion

  1. Istock: 9588509
  2. 9027968
  3. 9027968
  4. 9027968
  5. 9027968
  6. 9027968
  7. 9027968
  8. http://www.istockphoto.com/stock-illustration-8955603-community-network-kit.php
  9. 9027968
  10. 9027968
  11. 9027968
  12. 9027968
  13. 9027968
  14. 9027968
  15. 9027968