SlideShare une entreprise Scribd logo
1  sur  69
Télécharger pour lire hors ligne
Introduction and Asymmetric Encryption




             Introduction and Asymmetric Encryption

                                         Pascal Lafourcade

                                     Universit´ Joseph Fourier, Verimag
                                              e


                                          14th October 2008




                                                                          1 / 59
Introduction and Asymmetric Encryption
  Presentation



     Administrative Informations



      Where & When

         • 6 hours = 4 * 1h30 hours
         • Room: Amphi E or D207
         • Mardi 8h15 9h45 groupe 1
         • Mercredi 9h45 11h15 groupe 2




                                          2 / 59
Introduction and Asymmetric Encryption
  Presentation



     Instructor Information (I)
      Address

         • Instructor: Pascal Lafourcade
         • Address:
                                         VERIMAG, team DCS
                                         Center Equation CTL
                                         2, avenue de Vignate
                                             38610 Gi`res
                                                      e
         • Office: B4D CTL 1st floor
         • Email: pascal.lafourcade@imag.fr
         • Web: http://www-verimag.imag.fr/~plafourc/
         • Phone: +33 (0) 4 56 52 04 21 (but email is better)
         • Avaible most of the time in my office by appointment
                                                                3 / 59
Introduction and Asymmetric Encryption
  Presentation



     Instructor Information (II)
      Research in:
      Information Security, Formal Verification (Symbolic,
      Computational), Cryptographic Protocols, Rewriting, Unification,
      Equational Theories, Constraints:
         • e-voting
         • e-auction
         • Group protocols
         • Wireless communications
         • Tools
         • Computational world
         • ...

                                                                        4 / 59
Introduction and Asymmetric Encryption
  Presentation



     Web Pages



      Courses Web Pages:

         • Practical Informations online.
         • Slides, homework, references, articles...

       www-verimag.imag.fr/~plafourc




                                                       5 / 59
Introduction and Asymmetric Encryption
  Presentation




                                         What about YOU?

                                         Please fill the form.




                                                                6 / 59
Introduction and Asymmetric Encryption
  Presentation



     Prerequisites


      Some mathematical notions:
        • a little number theory,
        • ability to follow and do proofs,
          e.g., proof by induction, contradiction...
        • acquaintance with logic,
        • ease with formal notation and manipulation,
      but no advanced mathematics required.

      Please see me if you have any doubt or question.




                                                         7 / 59
Introduction and Asymmetric Encryption
  Presentation



     What is this course about?




      A presentation to basics and essential notions, techniques, models
      used in security and cryptography.




                                                                           8 / 59
Introduction and Asymmetric Encryption
  Presentation



     Course topics, in details



         • Introduction
         • Asymmetric Encryption
         • Symetric Encryption
         • Security Notions
         • Other Encryptions
      Today: Introduction and Asymetric Encryption




                                                     9 / 59
Introduction and Asymmetric Encryption
  Presentation



     Contents (I)


      Security touches many domains:
         • cryptography,
         • mathematics,
         • operating system,
         • networking,
      We should at least touch most of these topics, but we will not try
      to cover all aspects of security.




                                                                           10 / 59
Introduction and Asymmetric Encryption
  Presentation



     Contents (II)




         • Not a complete course on cryptography,



         • Not a complete course on security.




                                                    11 / 59
Introduction and Asymmetric Encryption
  Presentation



     Reading




      Required reading:

         • No textbook!
         • Many papers, indicated during the course.




                                                       12 / 59
Introduction and Asymmetric Encryption
  Presentation



     Some recommended book:
         • Bruce Schneier “Applied cryptography”,
         • Matt Bishop “Computer Security: Art and Science”,
         • Douglas Stinson “Cryptography: Theory and Practice”,
         • Two volumes of:
           “The Foundations of Cryptography” by Oded Goldreich
         • For background on cryptography, online book:
           “The handbook of applied cryptography” by Alfred J.
           Menezes, Paul C. van Oorschot and Scott A. Vanstone.
           www.cacr.math.uwaterloo.ca/hac/index.html
         • Simon Singh“The Code Book: The Secret History of Codes
           and Code Breaking”.
         • More online during the semester

                                                                    13 / 59
Introduction and Asymmetric Encryption
  Presentation



     Course work



         • Reading.
         • Class participation.
         • Homework:
             • Given and explained in class,
             • Given in the slides,
             • Usually due at the start of class one week later.




                                                                   14 / 59
Introduction and Asymmetric Encryption
  Presentation



     Outline


    1 Presentation

    2 Motivations

    3 History of Cryptography

    4 Classical Asymmetric Encryptions

    5 Conclusion




                                         15 / 59
Introduction and Asymmetric Encryption
  Motivations



     Outline


    1 Presentation

    2 Motivations

    3 History of Cryptography

    4 Classical Asymmetric Encryptions

    5 Conclusion




                                         16 / 59
Introduction and Asymmetric Encryption
  Motivations



     Typical security-critical problems

         • Secure communication, e.g., via telephone, email, fax.
           Objective: confidentiality and integrity of transmitted
           information.
         • Internet banking. Objectives: confidentiality of transactions
           and account information, prevention of false transactions,
           impossibility of repudiating (denying) a transaction by a user,
           ...
         • Digital payment systems.
         • E-voting systems, ...
      N.B.: specifying objectives (security properties) is not always easy.
      Neither is building systems that satisfy these objectives!


                                                                              17 / 59
Introduction and Asymmetric Encryption
  Motivations



     Traditional security properties


         • Common security properties are:
             - Confidentiality or Secrecy: No improper disclosure of
               information
                 - Authentification: To be sure to talk with the right person.
                   disclosure of information
                 - Integrity: No improper modification of information
                 - Availability: No improper impairment of functionality/service




                                                                                   18 / 59
Introduction and Asymmetric Encryption
  Motivations



     Authentication




                                         19 / 59
Introduction and Asymmetric Encryption
  Motivations



     Mechanisms for Authentication
         1   Something that you know
             E.g. a PIN or a password
         2   Something that you have
             E.g. a smart-card
         3   Something that you are
             Biometric characteristics like voice, fingerprints, eyes, ...
         4   Where you are located
             E.g. in a secure building
      Strong authentication combines multiple factors:
      E.g., Smart-Card + PIN



                                                                            20 / 59
Introduction and Asymmetric Encryption
  Motivations



     Other security properties


         • Non-repudiation (also called accountability) is where one can
             establish responsibility for actions.
         • Fairness is the fact there is no advantage to play one role in a
             protocol comparing with the other ones.
         • Privacy
              Anonymity: secrecy of principal identities or communication
                          relationships.
             Pseudonymity: anonymity plus link-ability.
             Data protection: personal data is only used in certain ways.



                                                                              21 / 59
Introduction and Asymmetric Encryption
  Motivations



     Example: banking


         • A bank may require
             • authenticity of clients (at teller, ATMs, or on the Internet),

                 • non-repudiation of transactions,

                 • integrity of accounts and other customer data,

                 • secrecy of customer data, and

                 • availability of logging.
         • The conjunction of these properties might constitute the
             bank’s (high-level) security policy.



                                                                                22 / 59
Introduction and Asymmetric Encryption
  Motivations



     Another example: e-voting


         • An e-voting system should ensure that
             • only registered voters vote,
             • each voter can only vote once,
             • integrity of votes,
             • privacy of voting information (only used for tallying), and
             • availability of system during voting period
         • In practice, many policy aspects are difficult to formulate
             precisely.
      Exercise (Due to next course): Give the security properties that an
      international airport should guarantee.



                                                                             23 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Outline


    1 Presentation

    2 Motivations

    3 History of Cryptography

    4 Classical Asymmetric Encryptions

    5 Conclusion




                                         24 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Information hiding




         • Cryptology: the study of secret writing.
         • Steganography: the science of hiding messages in other
             messages.
         • Cryptography: the science of secret writing.
             Note: terms like encrypt, encode, and encipher are often
             (loosely and wrongly) used interchangeably

                                                                        25 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Slave




                                         26 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Kerchoffs Principle



      In 1883, a Dutch linguist Auguste Kerchoff von Nieuwenhof stated
      in his book “La Cryptographie Militaire” that:

      “the security of a crypto-system must be totally dependent on the
             secrecy of the key, not the secrecy of the algorithm.”

      Authors name sometimes spelled Kerckhoff




                                                                          27 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Symmetric key and public key encryption
       • Symmetric key encryption
                                  encryption   decryption




            • Public key encryption
                                  encryption   decryption


                                 public key     private key




                                                              28 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Historical ciphers
         • Used 4000 years ago by Egyptians to encipher hieroglyphics.




         • Ancient Hebrews enciphered certain words in the scriptures.
         • 2000 years ago Julius Caesar used a simple substitution cipher.
         • Roger Bacon described several methods in 1200s.
         • Geoffrey Chaucer included several ciphers in his works.
         • Leon Alberti devised a cipher wheel, and described the
             principles of frequency analysis in the 1460s.

                                                                             29 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Mono-alphabetic substitution ciphers

         • Simplest kind of cipher. Idea over 2,000 years old.
         • Let K be the set of all permutations on the alphabet A.
             Define for each e ∈ K an encryption transformation Ee on
             strings m = m1 m2 · · · mn ∈ M as

                       Ee (m) = e(m1 )e(m2 ) · · · e(mn ) = c1 c2 · · · cn = c .

         • To decrypt c, compute the inverse permutation d = e −1 and

                                  Dd (c) = d(c1 )d(c2 ) · · · d(cn ) = m .

         • Ee is a simple substitution cipher or a mono-alphabetic
             substitution cipher.

                                                                                   30 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Substitution cipher examples


         • KHOOR ZRUOG




                                         31 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Substitution cipher examples


         • KHOOR ZRUOG = HELLO WORLD
             Caesar cipher: each plaintext character is replaced by the
             character three to the right modulo 26.




                                                                          31 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Substitution cipher examples


         • KHOOR ZRUOG = HELLO WORLD
             Caesar cipher: each plaintext character is replaced by the
             character three to the right modulo 26.
         • Zl anzr vf Nqnz




                                                                          31 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Substitution cipher examples


         • KHOOR ZRUOG = HELLO WORLD
             Caesar cipher: each plaintext character is replaced by the
             character three to the right modulo 26.
         • Zl anzr vf Nqnz = My name is Adam
             ROT13: shift each letter by 13 places.
             Under Unix: tr a-zA-Z n-za-mN-ZA-M.
         • 2-25-5 2-25-5




                                                                          31 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Substitution cipher examples


         • KHOOR ZRUOG = HELLO WORLD
             Caesar cipher: each plaintext character is replaced by the
             character three to the right modulo 26.
         • Zl anzr vf Nqnz = My name is Adam
             ROT13: shift each letter by 13 places.
             Under Unix: tr a-zA-Z n-za-mN-ZA-M.
         • 2-25-5 2-25-5 = BYE BYE
             Alphanumeric: substitute numbers for letters.
      How hard are these to cryptanalyze? Caesar? General?



                                                                          31 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     (In)security of substitution ciphers


         • Key spaces are typically huge. 26 letters     26! possible keys.
         • Trivial to crack using frequency analysis (letters, digraphs...)
         • Frequencies for English based on data-mining books/articles.




                                                                              32 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     How to break a monoalphabetic cipher




         • Guess the target language
         • Count letter frequencies in the cryptogram C
         • Match cryptogram’s frequencies with language’s frequencies
         • Use the partially decrypted message to correct errors.




                                                                        33 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Example


       WYSKBO KT CZWJB RCBTKAJSJA WC HJ WIJ ZGWIJS CZ MCAJSB RCMDYWJS TRKJBRJ. WYSKBO DSCFKAJA GB

      KBZLYJBWKGL ZCSMGLKTGWKCB CZ WIJ RCBRJDW CZ WIJ GLOCSKWIM GBA RCMDYWGWKCB NKWI WIJ WYSKBO

      MGRIKBJ. NKWI WIJ WYSKBO WJTW, IJ MGAJ G TKOBKZKRGBW GBA RIGSGRWJSKTWKRGLLX DSCFCRGWKFJ

      RCBWSKHYWKCB WC WIJ AJHGWJ SJOGSAKBO GSWKZKRKGL KBWJLLKOJBRJ: NIJWIJS KW NKLL JFJS HJ DCTTKHLJ

      WC TGX WIGW G MGRIKBJ KT RCBTRKCYT GBA RGB WIKBV. IJ LGWJS NCSVJA GW WIJ BGWKCBGL DIXTKRGL

      LGHCSGWCSX, RSJGWKBO CBJ CZ WIJ ZKSTW AJTKOBT ZCS G TWCSJA-DSCOSGM RCMDYWJS, GLWICYOI KW NGT

                          Frequencies: W (54), J (49), K (45), G (41), C (35),
      BJFJS GRWYGLLX HYKLW.

      B (35), S (32), I (24), R (24), L (20), T (19), A (14), O (13), Y (13), Z
      (12), M (10), D (9), H (7), N (6), F (5), X (5), V (2). Frequencies in
      english: ”ETAOIN SHRDLU”.



                                                                                                       34 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Example


      Try T → W and E → J:
      TYSKBO KW CZTEB RCBWKAESEA TC HE TIE ZGTIES CZ MCAESB RCMDYTES WRKEBRE. TYSKBO DSCFKAEA GB

      KBZLYEBTKGL ZCSMGLKWGTKCB CZ TIE RCBREDT CZ TIE GLOCSKTIM GBA RCMDYTGTKCB NKTI TIE TYSKBO

      MGRIKBE. NKTI TIE TYSKBO TEWT, IE MGAE G WKOBKZKRGBT GBA RIGSGRTESKWTKRGLLX DSCFCRGTKFE

      RCBTSKHYTKCB TC TIE AEHGTE SEOGSAKBO GSTKZKRKGL KBTELLKOEBRE: NIETIES KT NKLL EFES HE DCWWKHLE

      TC WGX TIGT G MGRIKBE KW RCBWRKCYW GBA RGB TIKBV. IE LGTES NCSVEA GT TIE BGTKCBGL DIXWKRGL

      LGHCSGTCSX, RSEGTKBO CBE CZ TIE ZKSWT AEWKOBW ZCS G WTCSEA-DSCOSGM RCMDYTES, GLTICYOI KT NGW

                          Frequencies: W (54), J (49), K (45), G (41), C (35),
      BEFES GRTYGLLX HYKLT.

      B (35), S (32), I (24), R (24), L (20), T (19), A (14), O (13), Y (13), Z
      (12), M (10), D (9), H (7), N (6), F (5), X (5), V (2).




                                                                                                       35 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Example


      Guess that TIE is THE and assume H → I:
      TYSKBO KW CZTEB RCBWKAESEA TC IE THE ZGTHES CZ MCAESB RCMDYTES WRKEBRE. TYSKBO DSCFKAEA GB
      KBZLYEBTKGL ZCSMGLKWGTKCB CZ THE RCBREDT CZ THE GLOCSKTHM GBA RCMDYTGTKCB NKTH THE TYSKBO
      MGRHKBE. NKTH THE TYSKBO TEWT, HE MGAE G WKOBKZKRGBT GBA RHGSGRTESKWTKRGLLX DSCFCRGTKFE
      RCBTSKIYTKCB TC THE AEIGTE SEOGSAKBO GSTKZKRKGL KBTELLKOEBRE: NHETHES KT NKLL EFES IE DCWWKILE
      TC WGX THGT G MGRHKBE KW RCBWRKCYW GBA RGB THKBV. HE LGTES NCSVEA GT THE BGTKCBGL DHXWKRGL
      LGICSGTCSX, RSEGTKBO CBE CZ THE ZKSWT AEWKOBW ZCS G WTCSEA-DSCOSGM RCMDYTES, GLTHCYOH KT NGW
      BEFES GRTYGLLX IYKLT.

      Frequencies: W (54), J (49), K (45), G (41), C (35), B (35), S (32), I
      (24), R (24), L (20), T (19), A (14), O (13), Y (13), Z (12), M (10), D
      (9), H (7), N (6), F (5), X (5), V (2).




                                                                                                       36 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Example


      Single letter-word ’G’: guess that A → G:
       TYSKBO KW CZTEB RCBWKGESEG TC IE THE ZATHES CZ MCGESB RCMDYTES WRKEBRE. TYSKBO DSCFKGEG AB

      KBZLYEBTKAL ZCSMALKWATKCB CZ THE RCBREDT CZ THE ALOCSKTHM ABG RCMDYTATKCB NKTH THE TYSKBO

      MARHKBE. NKTH THE TYSKBO TEWT, HE MAGE A WKOBKZKRABT ABG RHASARTESKWTKRALLX DSCFCRATKFE

      RCBTSKIYTKCB TC THE GEIATE SEOASGKBO ASTKZKRKAL KBTELLKOEBRE: NHETHES KT NKLL EFES IE DCWWKILE

      TC WAX THAT A MARHKBE KW RCBWRKCYW ABG RAB THKBV. HE LATES NCSVEG AT THE BATKCBAL DHXWKRAL

      LAICSATCSX, RSEATKBO CBE CZ THE ZKSWT GEWKOBW ZCS A WTCSEG-DSCOSAM RCMDYTES, ALTHCYOH KT NAW

                          Frequencies: W (54), J (49), K (45), G (41), C (35),
      BEFES ARTYALLX IYKLT.

      B (35), S (32), I (24), R (24), L (20), T (19), A (14), O (13), Y (13), Z
      (12), M (10), D (9), H (7), N (6), F (5), X (5), V (2).




                                                                                                       37 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Example


      Further guess consistent with frequencies: O → C, I → K, N → B.
       TYSINC IW OZTEN RONWIGESEG TO HE THE ZATHES OZ MOGESN ROMDYTES WRIENRE. TYSINC DSOFIGEG AN

      INZLYENTIAL ZOSMALIWATION OZ THE RONREDT OZ THE ALCOSITHM ANG ROMDYTATION BITH THE TYSINC

      MARHINE. BITH THE TYSINC TEWT, HE MAGE A WICNIZIRANT ANG RHASARTESIWTIRALLX DSOFORATIFE

      RONTSIHYTION TO THE GEHATE SECASGINC ASTIZIRIAL INTELLICENRE: BHETHES IT BILL EFES HE DOWWIHLE

      TO WAX THAT A MARHINE IW RONWRIOYW ANG RAN THINV. HE LATES BOSVEG AT THE NATIONAL DHXWIRAL

      LAHOSATOSX, RSEATINC ONE OZ THE ZISWT GEWICNW ZOS A WTOSEG-DSOCSAM ROMDYTES, ALTHOYCH IT BAW

                          Frequencies: W (54), J (49), K (45), G (41), C (35),
      NEFES ARTYALLX HYILT.

      B (35), S (32), I (24), R (24), L (20), T (19), A (14), O (13), Y (13), Z
      (12), M (10), D (9), H (7), N (6), F (5), X (5), V (2).




                                                                                                       38 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Example
      We’re almost done! Guess that ALCOSITHM is ALGORITHM, MARHINE is
      MACHINE. Clear text:
       TURING IS OFTEN CONSIDERED TO BE THE FATHER OF MODERN COMPUTER SCIENCE. TURING PROVIDED AN

      INFLUENTIAL FORMALISATION OF THE CONCEPT OF THE ALGORITHM AND COMPUTATION WITH THE TURING

      MACHINE. WITH THE TURING TEST, HE MADE A SIGNIFICANT AND CHARACTERISTICALLY PROVOCATIVE

      CONTRIBUTION TO THE DEBATE REGARDING ARTIFICIAL INTELLIGENCE: WHETHER IT WILL EVER BE POSSIBLE

      TO SAY THAT A MACHINE IS CONSCIOUS AND CAN THINK. HE LATER WORKED AT THE NATIONAL PHYSICAL

      LABORATORY, CREATING ONE OF THE FIRST DESIGNS FOR A STORED-PROGRAM COMPUTER, ALTHOUGH IT WAS

      NEVER ACTUALLY BUILT.




                                                                                                       39 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Example
      We’re almost done! Guess that ALCOSITHM is ALGORITHM, MARHINE is
      MACHINE. Clear text:
       TURING IS OFTEN CONSIDERED TO BE THE FATHER OF MODERN COMPUTER SCIENCE. TURING PROVIDED AN

      INFLUENTIAL FORMALISATION OF THE CONCEPT OF THE ALGORITHM AND COMPUTATION WITH THE TURING

      MACHINE. WITH THE TURING TEST, HE MADE A SIGNIFICANT AND CHARACTERISTICALLY PROVOCATIVE

      CONTRIBUTION TO THE DEBATE REGARDING ARTIFICIAL INTELLIGENCE: WHETHER IT WILL EVER BE POSSIBLE

      TO SAY THAT A MACHINE IS CONSCIOUS AND CAN THINK. HE LATER WORKED AT THE NATIONAL PHYSICAL

      LABORATORY, CREATING ONE OF THE FIRST DESIGNS FOR A STORED-PROGRAM COMPUTER, ALTHOUGH IT WAS

      NEVER ACTUALLY BUILT.

         • Easy to apply, except for short, atypical texts
             From Zanzibar to Zambia and Zaire, ozone zones make zebras
             run zany zigzags.
      ⇒ More sophistication required to mask statistical regularities.

                                                                                                       39 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Homophonic substitution ciphers

         • To each a ∈ A, associate a set H(a) of strings of t symbols,
             where H(a), a ∈ A are pairwise disjoint. A homophonic
             substitution cipher replaces each a with a randomly chosen
             string from H(a). To decrypt a string c of t symbols, one
             must determine an a ∈ A such that c ∈ H(a). The key for the
             cipher is the sets H(a).
         • Example: A = {a, b}, H(a) = {00, 10}, and
             H(b) = {01, 11}. The plaintext ab encrypts to one of 0001,
             0011, 1001, 1011.
         • Rational: makes frequency analysis more difficult.
             Cost: data expansion and more work for decryption.


                                                                           40 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Polyalphabetic substitution ciphers
         • Idea (Leon Alberti): conceal distribution using family of
             mappings.




         • A polyalphabetic substitution cipher is a block cipher with
             block length t over alphabet A where:
                 • the key space K consists of all ordered sets of t permutations
                    over A, (p1 , p2 , . . . , pt ).
                 • Encryption of m = m1 · · · mt under key e = (p1 , · · · , pt ) is
                    Ee (m) = p1 (m1 ) · · · pt (mt ).
                 • Decryption key for e is d = (p1 , · · · pt ).
                                                 −1         −1

                                                                                       41 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Example: Vigen`re ciphers
                   e

         • Key given by sequence of numbers e = e1 , . . . , et , where

                                         pi (a) = (a + ei ) mod n

             defining a permutation on an alphabet of size n.
         • Example: English (n = 26), with k = 3,7,10

               m = THI SCI PHE RIS CER TAI NLY NOT SEC URE

      then

        Ee (m) = WOS VJS SOO UPC FLB WHS QSI QVD VLM XYO


                                                                          42 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     One-time pads (Vernam cipher)
         • A one-time pad is a cipher defined over {0, 1}. Message
             m1 · · · mn is encrypted by a binary key string k1 · · · kn .
                        Ek1 ···kn (m1 · · · mn ) = (m1 ⊕ k1 ) · · · (mn ⊕ kn )
                          Dk1 ···kn (c1 · · · cn ) = (c1 ⊕ k1 ) · · · (cn ⊕ kn )
                      m = 010111
         • Example: k = 110010
                       c = 100101
         • Since every key sequence is equally likely, so is every plaintext!
           Unconditional (information theoretic) security, if key isn’t
           reused!
         • Moscow–Washington communication previously secured this
             way.
         • Problem?
                                                                                   43 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     One-time pads (Vernam cipher)
         • A one-time pad is a cipher defined over {0, 1}. Message
             m1 · · · mn is encrypted by a binary key string k1 · · · kn .
                        Ek1 ···kn (m1 · · · mn ) = (m1 ⊕ k1 ) · · · (mn ⊕ kn )
                          Dk1 ···kn (c1 · · · cn ) = (c1 ⊕ k1 ) · · · (cn ⊕ kn )
                      m = 010111
         • Example: k = 110010
                       c = 100101
         • Since every key sequence is equally likely, so is every plaintext!
           Unconditional (information theoretic) security, if key isn’t
           reused!
         • Moscow–Washington communication previously secured this
             way.
         • Problem? Securely exchanging and synchronizing long keys.
                                                                                   43 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Transposition ciphers

         • For block length t, let K be the set of permutations on
             {1, . . . , t}. For each e ∈ K and m ∈ M

                                         Ee (m) = me(1) me(2) · · · me(t) .

         • The set of all such transformations is called a transposition
             cipher.
         • To decrypt c = c1 c2 · · · ct compute
             Dd (c) = cd(1) cd(2) · · · cd(t) , where d is inverse permutation.
         • Letters unchanged so frequency analysis can be used to reveal
             if ciphertext is a transposition. Decrypt by exploiting
             frequency analysis for diphthongs, tripthongs, words, etc.


                                                                                  44 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Example: transposition ciphers
         • C = Aduaenttlydhatoiekounletmtoihahvsekeeeleeyqonouv




                                                                  45 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Example: transposition ciphers
         • C = Aduaenttlydhatoiekounletmtoihahvsekeeeleeyqonouv
                         A            n d i n          t h e        e   n
                         d            t h e l          o v e        y   o
                         u            t a k e          i s e        q   u
                         a            l t o t          h e l        o   v
                         e            y o u m          a k e
             Table defines a          permutation on   1, ..., 50.




                                                                            45 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Example: transposition ciphers
         • C = Aduaenttlydhatoiekounletmtoihahvsekeeeleeyqonouv
                       A n d i n t h e                   e   n
                       d t h e l           o v e         y   o
                       u t a k e i s e                   q   u
                       a l t o t           h e l         o   v
                       e y o u m a k e
           Table defines a permutation on 1, ..., 50.
         • Idea goes back to Greek Scytale: wrap belt    spirally around
           baton and write plaintext lengthwise on it.




                                                                           45 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Composite ciphers

         • Ciphers based on just substitutions or transpositions are not
             secure
         • Ciphers can be combined. However . . .
             • two substitutions are really only one more complex
               substitution,
             • two transpositions are really only one transposition,
             • but a substitution followed by a transposition makes a new
               harder cipher.
         • Product ciphers chain
           substitution-transposition combinations.
         • Difficult to do by hand
              invention of cipher machines.


                                                                            46 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     ENIGMA

      Three-rotor German military Enigma machine
      Dayly keys are used and stored in a book.
      There are 10114 possibilities for one cipher.


      Other German Tricks
      A space was omitted or replaced by an X. The X was generally
      used as point or full stop. They replaced the comma by Y and the
      question sign by UD. The combination CH, as in ”Acht” (eight) or
      ”Richtung” (direction) were replaced by Q (AQT, RIQTUNG).



                                                                         47 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Shannon’s Principle 1949
      Confusion
      The purpose of confusion is to make the relation between the key
      and the ciphertext as complex as possible.
      Ciphers that do not offer much confusion (such as Vigenere cipher)
      are susceptible to frequency analysis.




                                                                          48 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Shannon’s Principle 1949
      Confusion
      The purpose of confusion is to make the relation between the key
      and the ciphertext as complex as possible.
      Ciphers that do not offer much confusion (such as Vigenere cipher)
      are susceptible to frequency analysis.
      Diffusion
      Diffusion spreads the influence of a single plaintext bit over many
      ciphertext bits.
      The best diffusing component is substitution (homophonic)




                                                                          48 / 59
Introduction and Asymmetric Encryption
  History of Cryptography



     Shannon’s Principle 1949
      Confusion
      The purpose of confusion is to make the relation between the key
      and the ciphertext as complex as possible.
      Ciphers that do not offer much confusion (such as Vigenere cipher)
      are susceptible to frequency analysis.
      Diffusion
      Diffusion spreads the influence of a single plaintext bit over many
      ciphertext bits.
      The best diffusing component is substitution (homophonic)
      Principle
      A good cipher design uses Confusion and Diffusion together
                                                                          48 / 59
Introduction and Asymmetric Encryption
  Classical Asymmetric Encryptions



     Outline


    1 Presentation

    2 Motivations

    3 History of Cryptography

    4 Classical Asymmetric Encryptions

    5 Conclusion




                                         49 / 59
Introduction and Asymmetric Encryption
  Classical Asymmetric Encryptions



     One-way function and Trapdoor

      Definition
      A function is One-way, if :
         • it is easy to compute
         • its inverse is hard to compute :
                                     r
                           Pr[m ← {0, 1}∗ ; y := f (m) : f (A(y , f )) = y ]

             is negligible.

      Trapdoor:
         • Inverse is easy to compute given an additional information (an
             inverse key e.g. in RSA).

                                                                               50 / 59
Introduction and Asymmetric Encryption
  Classical Asymmetric Encryptions



     Integer Factoring



      → Use of algorithmically hard problems.
      Factorization

         • p, q → n = p.q                easy (quadratic)
         • n = p.q → p, q                difficult




                                                            51 / 59
Introduction and Asymmetric Encryption
  Classical Asymmetric Encryptions



     RSA

      RSA function n = pq, p and q primes.
      e: public exponent
         • x → x e mod n                 easy (cubic)
         • y =      xe   → x mod n difficult
             x=     yd   where d = e −1 mod φ(n)

      Soundness
      Assume n = pq, gcd(e, φ(n)) = 1 and d = e − 1 mod φ(n).
      c d = mde = m.mkφ(n) mod n
      According to the Fermat Little Theorem ∀x ∈ (Z/nZ)∗ , x φ(n) = 1



                                                                         52 / 59
Introduction and Asymmetric Encryption
  Classical Asymmetric Encryptions



     Example RSA
      Example

         • p = 61 (destroy this after computing E and D)
         • q = 53 (destroy this after computing E and D)
         • n = pq = 3233 modulus (give this to others)
         • e = 17 public exponent (give this to others)
         • d = 2753 private exponent (keep this secret!)

      Your public key is (e, n) and your private key is d.
      encrypt(T ) = (T e ) mod n = (T 17 ) mod 3233
      decrypt(C ) = (C d ) mod n(C 2753 ) mod 3233
         • encrypt(123) = 12317 mod 3233
             = 337587917446653715596592958817679803 mod 3233
             = 855
                                                               53 / 59
         • decrypt(855) = 8552753 mod 3233
Introduction and Asymmetric Encryption
  Classical Asymmetric Encryptions



     Complexity Estimates

      Estimates for integer factoring Lenstra-Verheul 2000


                               Modulus   Operations
                                (bits)     (log2 )
                                 512         58
                                1024         80     ≈ 260 years
                                2048        111
                                4096        149
                                8192        156

      → Can be used for RSA too.


                                                                  54 / 59
Introduction and Asymmetric Encryption
  Classical Asymmetric Encryptions



     ElGamal Encryption Scheme
      Key generation: Alice chooses a prime number p and a group
           generator g of (Z/pZ)∗ and a ∈ (Z/(p − 1)Z)∗ .
      Public key: (p, g , h), where h = g a mod p.
      Private key: a
      Encryption: Bob chooses r ∈R (Z/(p − 1)Z)∗ and computes
           (u, v ) = (g r , Mhr )
                                                     v
      Decryption: Given (u, v ), Alice computes M ≡p ua
                                 r
      Justification: ua = Mh ≡p M
                      v
                             g ra
      Remarque: re-usage of the same random r leads to a security flaw:
                                         M1 h r    M1
                                              r
                                                ≡p
                                         M2 h      M2
      Practical Inconvenience: Cipher is twice as long as plain text.

                                                                         55 / 59
Introduction and Asymmetric Encryption
  Conclusion



     Outline


    1 Presentation

    2 Motivations

    3 History of Cryptography

    4 Classical Asymmetric Encryptions

    5 Conclusion




                                         56 / 59
Introduction and Asymmetric Encryption
  Conclusion



     Summary



      Today

         • Presentation
         • Motivation
         • History of Cryptography
         • Classical Asymetric Encryption




                                            57 / 59
Introduction and Asymmetric Encryption
  Conclusion



     Next Time




         • Classical Symmetric Encryption
         • Security Notions
         • Examples




                                            58 / 59
Introduction and Asymmetric Encryption
  Conclusion




                                   Thank you for your attention


                                           Questions ?




                                                                  59 / 59

Contenu connexe

En vedette

Upgrading_and_Migrating_to_Exchange_Server_2007_and_Windows_2008
Upgrading_and_Migrating_to_Exchange_Server_2007_and_Windows_2008Upgrading_and_Migrating_to_Exchange_Server_2007_and_Windows_2008
Upgrading_and_Migrating_to_Exchange_Server_2007_and_Windows_2008Balaji Ravi
 
Presentation1
Presentation1Presentation1
Presentation1148359
 
Quest_Software_Best_Practices_for_Exchange_2007
Quest_Software_Best_Practices_for_Exchange_2007Quest_Software_Best_Practices_for_Exchange_2007
Quest_Software_Best_Practices_for_Exchange_2007Balaji Ravi
 
3852_wlan_revised
3852_wlan_revised3852_wlan_revised
3852_wlan_revisedBalaji Ravi
 
Virtualizing_Exchange2003
Virtualizing_Exchange2003Virtualizing_Exchange2003
Virtualizing_Exchange2003Balaji Ravi
 

En vedette (9)

10307021
1030702110307021
10307021
 
Upgrading_and_Migrating_to_Exchange_Server_2007_and_Windows_2008
Upgrading_and_Migrating_to_Exchange_Server_2007_and_Windows_2008Upgrading_and_Migrating_to_Exchange_Server_2007_and_Windows_2008
Upgrading_and_Migrating_to_Exchange_Server_2007_and_Windows_2008
 
exch2003
exch2003exch2003
exch2003
 
Presentation1
Presentation1Presentation1
Presentation1
 
Quest_Software_Best_Practices_for_Exchange_2007
Quest_Software_Best_Practices_for_Exchange_2007Quest_Software_Best_Practices_for_Exchange_2007
Quest_Software_Best_Practices_for_Exchange_2007
 
3852_wlan_revised
3852_wlan_revised3852_wlan_revised
3852_wlan_revised
 
Virtualizing_Exchange2003
Virtualizing_Exchange2003Virtualizing_Exchange2003
Virtualizing_Exchange2003
 
La te x
La te xLa te x
La te x
 
b
bb
b
 

Similaire à a

Encryption techniques
Encryption techniquesEncryption techniques
Encryption techniquesMohitManna
 
Making Sense Of Cryptography
Making Sense Of CryptographyMaking Sense Of Cryptography
Making Sense Of Cryptographymarkjhouse
 
Introduction to cryptography part1-final
Introduction to cryptography  part1-finalIntroduction to cryptography  part1-final
Introduction to cryptography part1-finalTaymoor Nazmy
 
Hacking Smartcards & RFID
Hacking Smartcards & RFIDHacking Smartcards & RFID
Hacking Smartcards & RFIDDevnology
 
Information and network security 31 public key cryptography
Information and network security 31 public key cryptographyInformation and network security 31 public key cryptography
Information and network security 31 public key cryptographyVaibhav Khanna
 
Web-of-Things and Services Security
Web-of-Things and Services SecurityWeb-of-Things and Services Security
Web-of-Things and Services SecurityOliver Pfaff
 
Protecting Sensitive Data (and be PCI Compliant too!)
Protecting Sensitive Data (and be PCI Compliant too!)Protecting Sensitive Data (and be PCI Compliant too!)
Protecting Sensitive Data (and be PCI Compliant too!)Security Innovation
 
Workshop on 03 11-2012
Workshop on 03 11-2012Workshop on 03 11-2012
Workshop on 03 11-2012Gaurav Gautam
 
HIS 2015: Tom Chothia - Formal Security of Critical Infrastructure
HIS 2015: Tom Chothia - Formal Security of Critical InfrastructureHIS 2015: Tom Chothia - Formal Security of Critical Infrastructure
HIS 2015: Tom Chothia - Formal Security of Critical InfrastructureAdaCore
 
Chapter 1- Fundamentals of Cryptography.pdf
Chapter 1- Fundamentals of Cryptography.pdfChapter 1- Fundamentals of Cryptography.pdf
Chapter 1- Fundamentals of Cryptography.pdfkiyya3
 
Cryptography and Network Security-ch1-4.pptx
Cryptography and Network Security-ch1-4.pptxCryptography and Network Security-ch1-4.pptx
Cryptography and Network Security-ch1-4.pptxSamiDan3
 
Security in Computer System
Security in Computer SystemSecurity in Computer System
Security in Computer SystemManesh T
 
Security in computer systems fundamentals
Security in computer systems fundamentalsSecurity in computer systems fundamentals
Security in computer systems fundamentalsManesh T
 
Cryptography and network security
Cryptography and network security Cryptography and network security
Cryptography and network security Mathan Gopal
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network securityShanthi Mathan
 
Introduction to IS course
Introduction to IS courseIntroduction to IS course
Introduction to IS courseHoang Nguyen
 

Similaire à a (20)

Ccc brochure
Ccc brochureCcc brochure
Ccc brochure
 
Encryption techniques
Encryption techniquesEncryption techniques
Encryption techniques
 
Making Sense Of Cryptography
Making Sense Of CryptographyMaking Sense Of Cryptography
Making Sense Of Cryptography
 
Introduction to cryptography part1-final
Introduction to cryptography  part1-finalIntroduction to cryptography  part1-final
Introduction to cryptography part1-final
 
Hacking Smartcards & RFID
Hacking Smartcards & RFIDHacking Smartcards & RFID
Hacking Smartcards & RFID
 
Cryptography
Cryptography Cryptography
Cryptography
 
Information and network security 31 public key cryptography
Information and network security 31 public key cryptographyInformation and network security 31 public key cryptography
Information and network security 31 public key cryptography
 
Web-of-Things and Services Security
Web-of-Things and Services SecurityWeb-of-Things and Services Security
Web-of-Things and Services Security
 
Protecting Sensitive Data (and be PCI Compliant too!)
Protecting Sensitive Data (and be PCI Compliant too!)Protecting Sensitive Data (and be PCI Compliant too!)
Protecting Sensitive Data (and be PCI Compliant too!)
 
Workshop on 03 11-2012
Workshop on 03 11-2012Workshop on 03 11-2012
Workshop on 03 11-2012
 
HIS 2015: Tom Chothia - Formal Security of Critical Infrastructure
HIS 2015: Tom Chothia - Formal Security of Critical InfrastructureHIS 2015: Tom Chothia - Formal Security of Critical Infrastructure
HIS 2015: Tom Chothia - Formal Security of Critical Infrastructure
 
Chapter 1- Fundamentals of Cryptography.pdf
Chapter 1- Fundamentals of Cryptography.pdfChapter 1- Fundamentals of Cryptography.pdf
Chapter 1- Fundamentals of Cryptography.pdf
 
Cryptography and Network Security-ch1-4.pptx
Cryptography and Network Security-ch1-4.pptxCryptography and Network Security-ch1-4.pptx
Cryptography and Network Security-ch1-4.pptx
 
Security in Computer System
Security in Computer SystemSecurity in Computer System
Security in Computer System
 
Crytography
CrytographyCrytography
Crytography
 
Security in computer systems fundamentals
Security in computer systems fundamentalsSecurity in computer systems fundamentals
Security in computer systems fundamentals
 
Cryptography and network security
Cryptography and network security Cryptography and network security
Cryptography and network security
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
 
Introduction to IS course
Introduction to IS courseIntroduction to IS course
Introduction to IS course
 
Networksecurity1 1
Networksecurity1 1 Networksecurity1 1
Networksecurity1 1
 

Plus de Balaji Ravi

Plus de Balaji Ravi (10)

forgot_administrator_password.htm
forgot_administrator_password.htmforgot_administrator_password.htm
forgot_administrator_password.htm
 
lost-xp-password.html
lost-xp-password.htmllost-xp-password.html
lost-xp-password.html
 
1.Routing-eng
1.Routing-eng1.Routing-eng
1.Routing-eng
 
Practical-LDAP-and-Linux
Practical-LDAP-and-LinuxPractical-LDAP-and-Linux
Practical-LDAP-and-Linux
 
bldef_ap.htm
bldef_ap.htmbldef_ap.htm
bldef_ap.htm
 
L03-ajc-C-arrays
L03-ajc-C-arraysL03-ajc-C-arrays
L03-ajc-C-arrays
 
show.php.htm
show.php.htmshow.php.htm
show.php.htm
 
182
182182
182
 
cryptography
cryptographycryptography
cryptography
 
Balaji
BalajiBalaji
Balaji
 

a

  • 1. Introduction and Asymmetric Encryption Introduction and Asymmetric Encryption Pascal Lafourcade Universit´ Joseph Fourier, Verimag e 14th October 2008 1 / 59
  • 2. Introduction and Asymmetric Encryption Presentation Administrative Informations Where & When • 6 hours = 4 * 1h30 hours • Room: Amphi E or D207 • Mardi 8h15 9h45 groupe 1 • Mercredi 9h45 11h15 groupe 2 2 / 59
  • 3. Introduction and Asymmetric Encryption Presentation Instructor Information (I) Address • Instructor: Pascal Lafourcade • Address: VERIMAG, team DCS Center Equation CTL 2, avenue de Vignate 38610 Gi`res e • Office: B4D CTL 1st floor • Email: pascal.lafourcade@imag.fr • Web: http://www-verimag.imag.fr/~plafourc/ • Phone: +33 (0) 4 56 52 04 21 (but email is better) • Avaible most of the time in my office by appointment 3 / 59
  • 4. Introduction and Asymmetric Encryption Presentation Instructor Information (II) Research in: Information Security, Formal Verification (Symbolic, Computational), Cryptographic Protocols, Rewriting, Unification, Equational Theories, Constraints: • e-voting • e-auction • Group protocols • Wireless communications • Tools • Computational world • ... 4 / 59
  • 5. Introduction and Asymmetric Encryption Presentation Web Pages Courses Web Pages: • Practical Informations online. • Slides, homework, references, articles... www-verimag.imag.fr/~plafourc 5 / 59
  • 6. Introduction and Asymmetric Encryption Presentation What about YOU? Please fill the form. 6 / 59
  • 7. Introduction and Asymmetric Encryption Presentation Prerequisites Some mathematical notions: • a little number theory, • ability to follow and do proofs, e.g., proof by induction, contradiction... • acquaintance with logic, • ease with formal notation and manipulation, but no advanced mathematics required. Please see me if you have any doubt or question. 7 / 59
  • 8. Introduction and Asymmetric Encryption Presentation What is this course about? A presentation to basics and essential notions, techniques, models used in security and cryptography. 8 / 59
  • 9. Introduction and Asymmetric Encryption Presentation Course topics, in details • Introduction • Asymmetric Encryption • Symetric Encryption • Security Notions • Other Encryptions Today: Introduction and Asymetric Encryption 9 / 59
  • 10. Introduction and Asymmetric Encryption Presentation Contents (I) Security touches many domains: • cryptography, • mathematics, • operating system, • networking, We should at least touch most of these topics, but we will not try to cover all aspects of security. 10 / 59
  • 11. Introduction and Asymmetric Encryption Presentation Contents (II) • Not a complete course on cryptography, • Not a complete course on security. 11 / 59
  • 12. Introduction and Asymmetric Encryption Presentation Reading Required reading: • No textbook! • Many papers, indicated during the course. 12 / 59
  • 13. Introduction and Asymmetric Encryption Presentation Some recommended book: • Bruce Schneier “Applied cryptography”, • Matt Bishop “Computer Security: Art and Science”, • Douglas Stinson “Cryptography: Theory and Practice”, • Two volumes of: “The Foundations of Cryptography” by Oded Goldreich • For background on cryptography, online book: “The handbook of applied cryptography” by Alfred J. Menezes, Paul C. van Oorschot and Scott A. Vanstone. www.cacr.math.uwaterloo.ca/hac/index.html • Simon Singh“The Code Book: The Secret History of Codes and Code Breaking”. • More online during the semester 13 / 59
  • 14. Introduction and Asymmetric Encryption Presentation Course work • Reading. • Class participation. • Homework: • Given and explained in class, • Given in the slides, • Usually due at the start of class one week later. 14 / 59
  • 15. Introduction and Asymmetric Encryption Presentation Outline 1 Presentation 2 Motivations 3 History of Cryptography 4 Classical Asymmetric Encryptions 5 Conclusion 15 / 59
  • 16. Introduction and Asymmetric Encryption Motivations Outline 1 Presentation 2 Motivations 3 History of Cryptography 4 Classical Asymmetric Encryptions 5 Conclusion 16 / 59
  • 17. Introduction and Asymmetric Encryption Motivations Typical security-critical problems • Secure communication, e.g., via telephone, email, fax. Objective: confidentiality and integrity of transmitted information. • Internet banking. Objectives: confidentiality of transactions and account information, prevention of false transactions, impossibility of repudiating (denying) a transaction by a user, ... • Digital payment systems. • E-voting systems, ... N.B.: specifying objectives (security properties) is not always easy. Neither is building systems that satisfy these objectives! 17 / 59
  • 18. Introduction and Asymmetric Encryption Motivations Traditional security properties • Common security properties are: - Confidentiality or Secrecy: No improper disclosure of information - Authentification: To be sure to talk with the right person. disclosure of information - Integrity: No improper modification of information - Availability: No improper impairment of functionality/service 18 / 59
  • 19. Introduction and Asymmetric Encryption Motivations Authentication 19 / 59
  • 20. Introduction and Asymmetric Encryption Motivations Mechanisms for Authentication 1 Something that you know E.g. a PIN or a password 2 Something that you have E.g. a smart-card 3 Something that you are Biometric characteristics like voice, fingerprints, eyes, ... 4 Where you are located E.g. in a secure building Strong authentication combines multiple factors: E.g., Smart-Card + PIN 20 / 59
  • 21. Introduction and Asymmetric Encryption Motivations Other security properties • Non-repudiation (also called accountability) is where one can establish responsibility for actions. • Fairness is the fact there is no advantage to play one role in a protocol comparing with the other ones. • Privacy Anonymity: secrecy of principal identities or communication relationships. Pseudonymity: anonymity plus link-ability. Data protection: personal data is only used in certain ways. 21 / 59
  • 22. Introduction and Asymmetric Encryption Motivations Example: banking • A bank may require • authenticity of clients (at teller, ATMs, or on the Internet), • non-repudiation of transactions, • integrity of accounts and other customer data, • secrecy of customer data, and • availability of logging. • The conjunction of these properties might constitute the bank’s (high-level) security policy. 22 / 59
  • 23. Introduction and Asymmetric Encryption Motivations Another example: e-voting • An e-voting system should ensure that • only registered voters vote, • each voter can only vote once, • integrity of votes, • privacy of voting information (only used for tallying), and • availability of system during voting period • In practice, many policy aspects are difficult to formulate precisely. Exercise (Due to next course): Give the security properties that an international airport should guarantee. 23 / 59
  • 24. Introduction and Asymmetric Encryption History of Cryptography Outline 1 Presentation 2 Motivations 3 History of Cryptography 4 Classical Asymmetric Encryptions 5 Conclusion 24 / 59
  • 25. Introduction and Asymmetric Encryption History of Cryptography Information hiding • Cryptology: the study of secret writing. • Steganography: the science of hiding messages in other messages. • Cryptography: the science of secret writing. Note: terms like encrypt, encode, and encipher are often (loosely and wrongly) used interchangeably 25 / 59
  • 26. Introduction and Asymmetric Encryption History of Cryptography Slave 26 / 59
  • 27. Introduction and Asymmetric Encryption History of Cryptography Kerchoffs Principle In 1883, a Dutch linguist Auguste Kerchoff von Nieuwenhof stated in his book “La Cryptographie Militaire” that: “the security of a crypto-system must be totally dependent on the secrecy of the key, not the secrecy of the algorithm.” Authors name sometimes spelled Kerckhoff 27 / 59
  • 28. Introduction and Asymmetric Encryption History of Cryptography Symmetric key and public key encryption • Symmetric key encryption encryption decryption • Public key encryption encryption decryption public key private key 28 / 59
  • 29. Introduction and Asymmetric Encryption History of Cryptography Historical ciphers • Used 4000 years ago by Egyptians to encipher hieroglyphics. • Ancient Hebrews enciphered certain words in the scriptures. • 2000 years ago Julius Caesar used a simple substitution cipher. • Roger Bacon described several methods in 1200s. • Geoffrey Chaucer included several ciphers in his works. • Leon Alberti devised a cipher wheel, and described the principles of frequency analysis in the 1460s. 29 / 59
  • 30. Introduction and Asymmetric Encryption History of Cryptography Mono-alphabetic substitution ciphers • Simplest kind of cipher. Idea over 2,000 years old. • Let K be the set of all permutations on the alphabet A. Define for each e ∈ K an encryption transformation Ee on strings m = m1 m2 · · · mn ∈ M as Ee (m) = e(m1 )e(m2 ) · · · e(mn ) = c1 c2 · · · cn = c . • To decrypt c, compute the inverse permutation d = e −1 and Dd (c) = d(c1 )d(c2 ) · · · d(cn ) = m . • Ee is a simple substitution cipher or a mono-alphabetic substitution cipher. 30 / 59
  • 31. Introduction and Asymmetric Encryption History of Cryptography Substitution cipher examples • KHOOR ZRUOG 31 / 59
  • 32. Introduction and Asymmetric Encryption History of Cryptography Substitution cipher examples • KHOOR ZRUOG = HELLO WORLD Caesar cipher: each plaintext character is replaced by the character three to the right modulo 26. 31 / 59
  • 33. Introduction and Asymmetric Encryption History of Cryptography Substitution cipher examples • KHOOR ZRUOG = HELLO WORLD Caesar cipher: each plaintext character is replaced by the character three to the right modulo 26. • Zl anzr vf Nqnz 31 / 59
  • 34. Introduction and Asymmetric Encryption History of Cryptography Substitution cipher examples • KHOOR ZRUOG = HELLO WORLD Caesar cipher: each plaintext character is replaced by the character three to the right modulo 26. • Zl anzr vf Nqnz = My name is Adam ROT13: shift each letter by 13 places. Under Unix: tr a-zA-Z n-za-mN-ZA-M. • 2-25-5 2-25-5 31 / 59
  • 35. Introduction and Asymmetric Encryption History of Cryptography Substitution cipher examples • KHOOR ZRUOG = HELLO WORLD Caesar cipher: each plaintext character is replaced by the character three to the right modulo 26. • Zl anzr vf Nqnz = My name is Adam ROT13: shift each letter by 13 places. Under Unix: tr a-zA-Z n-za-mN-ZA-M. • 2-25-5 2-25-5 = BYE BYE Alphanumeric: substitute numbers for letters. How hard are these to cryptanalyze? Caesar? General? 31 / 59
  • 36. Introduction and Asymmetric Encryption History of Cryptography (In)security of substitution ciphers • Key spaces are typically huge. 26 letters 26! possible keys. • Trivial to crack using frequency analysis (letters, digraphs...) • Frequencies for English based on data-mining books/articles. 32 / 59
  • 37. Introduction and Asymmetric Encryption History of Cryptography How to break a monoalphabetic cipher • Guess the target language • Count letter frequencies in the cryptogram C • Match cryptogram’s frequencies with language’s frequencies • Use the partially decrypted message to correct errors. 33 / 59
  • 38. Introduction and Asymmetric Encryption History of Cryptography Example WYSKBO KT CZWJB RCBTKAJSJA WC HJ WIJ ZGWIJS CZ MCAJSB RCMDYWJS TRKJBRJ. WYSKBO DSCFKAJA GB KBZLYJBWKGL ZCSMGLKTGWKCB CZ WIJ RCBRJDW CZ WIJ GLOCSKWIM GBA RCMDYWGWKCB NKWI WIJ WYSKBO MGRIKBJ. NKWI WIJ WYSKBO WJTW, IJ MGAJ G TKOBKZKRGBW GBA RIGSGRWJSKTWKRGLLX DSCFCRGWKFJ RCBWSKHYWKCB WC WIJ AJHGWJ SJOGSAKBO GSWKZKRKGL KBWJLLKOJBRJ: NIJWIJS KW NKLL JFJS HJ DCTTKHLJ WC TGX WIGW G MGRIKBJ KT RCBTRKCYT GBA RGB WIKBV. IJ LGWJS NCSVJA GW WIJ BGWKCBGL DIXTKRGL LGHCSGWCSX, RSJGWKBO CBJ CZ WIJ ZKSTW AJTKOBT ZCS G TWCSJA-DSCOSGM RCMDYWJS, GLWICYOI KW NGT Frequencies: W (54), J (49), K (45), G (41), C (35), BJFJS GRWYGLLX HYKLW. B (35), S (32), I (24), R (24), L (20), T (19), A (14), O (13), Y (13), Z (12), M (10), D (9), H (7), N (6), F (5), X (5), V (2). Frequencies in english: ”ETAOIN SHRDLU”. 34 / 59
  • 39. Introduction and Asymmetric Encryption History of Cryptography Example Try T → W and E → J: TYSKBO KW CZTEB RCBWKAESEA TC HE TIE ZGTIES CZ MCAESB RCMDYTES WRKEBRE. TYSKBO DSCFKAEA GB KBZLYEBTKGL ZCSMGLKWGTKCB CZ TIE RCBREDT CZ TIE GLOCSKTIM GBA RCMDYTGTKCB NKTI TIE TYSKBO MGRIKBE. NKTI TIE TYSKBO TEWT, IE MGAE G WKOBKZKRGBT GBA RIGSGRTESKWTKRGLLX DSCFCRGTKFE RCBTSKHYTKCB TC TIE AEHGTE SEOGSAKBO GSTKZKRKGL KBTELLKOEBRE: NIETIES KT NKLL EFES HE DCWWKHLE TC WGX TIGT G MGRIKBE KW RCBWRKCYW GBA RGB TIKBV. IE LGTES NCSVEA GT TIE BGTKCBGL DIXWKRGL LGHCSGTCSX, RSEGTKBO CBE CZ TIE ZKSWT AEWKOBW ZCS G WTCSEA-DSCOSGM RCMDYTES, GLTICYOI KT NGW Frequencies: W (54), J (49), K (45), G (41), C (35), BEFES GRTYGLLX HYKLT. B (35), S (32), I (24), R (24), L (20), T (19), A (14), O (13), Y (13), Z (12), M (10), D (9), H (7), N (6), F (5), X (5), V (2). 35 / 59
  • 40. Introduction and Asymmetric Encryption History of Cryptography Example Guess that TIE is THE and assume H → I: TYSKBO KW CZTEB RCBWKAESEA TC IE THE ZGTHES CZ MCAESB RCMDYTES WRKEBRE. TYSKBO DSCFKAEA GB KBZLYEBTKGL ZCSMGLKWGTKCB CZ THE RCBREDT CZ THE GLOCSKTHM GBA RCMDYTGTKCB NKTH THE TYSKBO MGRHKBE. NKTH THE TYSKBO TEWT, HE MGAE G WKOBKZKRGBT GBA RHGSGRTESKWTKRGLLX DSCFCRGTKFE RCBTSKIYTKCB TC THE AEIGTE SEOGSAKBO GSTKZKRKGL KBTELLKOEBRE: NHETHES KT NKLL EFES IE DCWWKILE TC WGX THGT G MGRHKBE KW RCBWRKCYW GBA RGB THKBV. HE LGTES NCSVEA GT THE BGTKCBGL DHXWKRGL LGICSGTCSX, RSEGTKBO CBE CZ THE ZKSWT AEWKOBW ZCS G WTCSEA-DSCOSGM RCMDYTES, GLTHCYOH KT NGW BEFES GRTYGLLX IYKLT. Frequencies: W (54), J (49), K (45), G (41), C (35), B (35), S (32), I (24), R (24), L (20), T (19), A (14), O (13), Y (13), Z (12), M (10), D (9), H (7), N (6), F (5), X (5), V (2). 36 / 59
  • 41. Introduction and Asymmetric Encryption History of Cryptography Example Single letter-word ’G’: guess that A → G: TYSKBO KW CZTEB RCBWKGESEG TC IE THE ZATHES CZ MCGESB RCMDYTES WRKEBRE. TYSKBO DSCFKGEG AB KBZLYEBTKAL ZCSMALKWATKCB CZ THE RCBREDT CZ THE ALOCSKTHM ABG RCMDYTATKCB NKTH THE TYSKBO MARHKBE. NKTH THE TYSKBO TEWT, HE MAGE A WKOBKZKRABT ABG RHASARTESKWTKRALLX DSCFCRATKFE RCBTSKIYTKCB TC THE GEIATE SEOASGKBO ASTKZKRKAL KBTELLKOEBRE: NHETHES KT NKLL EFES IE DCWWKILE TC WAX THAT A MARHKBE KW RCBWRKCYW ABG RAB THKBV. HE LATES NCSVEG AT THE BATKCBAL DHXWKRAL LAICSATCSX, RSEATKBO CBE CZ THE ZKSWT GEWKOBW ZCS A WTCSEG-DSCOSAM RCMDYTES, ALTHCYOH KT NAW Frequencies: W (54), J (49), K (45), G (41), C (35), BEFES ARTYALLX IYKLT. B (35), S (32), I (24), R (24), L (20), T (19), A (14), O (13), Y (13), Z (12), M (10), D (9), H (7), N (6), F (5), X (5), V (2). 37 / 59
  • 42. Introduction and Asymmetric Encryption History of Cryptography Example Further guess consistent with frequencies: O → C, I → K, N → B. TYSINC IW OZTEN RONWIGESEG TO HE THE ZATHES OZ MOGESN ROMDYTES WRIENRE. TYSINC DSOFIGEG AN INZLYENTIAL ZOSMALIWATION OZ THE RONREDT OZ THE ALCOSITHM ANG ROMDYTATION BITH THE TYSINC MARHINE. BITH THE TYSINC TEWT, HE MAGE A WICNIZIRANT ANG RHASARTESIWTIRALLX DSOFORATIFE RONTSIHYTION TO THE GEHATE SECASGINC ASTIZIRIAL INTELLICENRE: BHETHES IT BILL EFES HE DOWWIHLE TO WAX THAT A MARHINE IW RONWRIOYW ANG RAN THINV. HE LATES BOSVEG AT THE NATIONAL DHXWIRAL LAHOSATOSX, RSEATINC ONE OZ THE ZISWT GEWICNW ZOS A WTOSEG-DSOCSAM ROMDYTES, ALTHOYCH IT BAW Frequencies: W (54), J (49), K (45), G (41), C (35), NEFES ARTYALLX HYILT. B (35), S (32), I (24), R (24), L (20), T (19), A (14), O (13), Y (13), Z (12), M (10), D (9), H (7), N (6), F (5), X (5), V (2). 38 / 59
  • 43. Introduction and Asymmetric Encryption History of Cryptography Example We’re almost done! Guess that ALCOSITHM is ALGORITHM, MARHINE is MACHINE. Clear text: TURING IS OFTEN CONSIDERED TO BE THE FATHER OF MODERN COMPUTER SCIENCE. TURING PROVIDED AN INFLUENTIAL FORMALISATION OF THE CONCEPT OF THE ALGORITHM AND COMPUTATION WITH THE TURING MACHINE. WITH THE TURING TEST, HE MADE A SIGNIFICANT AND CHARACTERISTICALLY PROVOCATIVE CONTRIBUTION TO THE DEBATE REGARDING ARTIFICIAL INTELLIGENCE: WHETHER IT WILL EVER BE POSSIBLE TO SAY THAT A MACHINE IS CONSCIOUS AND CAN THINK. HE LATER WORKED AT THE NATIONAL PHYSICAL LABORATORY, CREATING ONE OF THE FIRST DESIGNS FOR A STORED-PROGRAM COMPUTER, ALTHOUGH IT WAS NEVER ACTUALLY BUILT. 39 / 59
  • 44. Introduction and Asymmetric Encryption History of Cryptography Example We’re almost done! Guess that ALCOSITHM is ALGORITHM, MARHINE is MACHINE. Clear text: TURING IS OFTEN CONSIDERED TO BE THE FATHER OF MODERN COMPUTER SCIENCE. TURING PROVIDED AN INFLUENTIAL FORMALISATION OF THE CONCEPT OF THE ALGORITHM AND COMPUTATION WITH THE TURING MACHINE. WITH THE TURING TEST, HE MADE A SIGNIFICANT AND CHARACTERISTICALLY PROVOCATIVE CONTRIBUTION TO THE DEBATE REGARDING ARTIFICIAL INTELLIGENCE: WHETHER IT WILL EVER BE POSSIBLE TO SAY THAT A MACHINE IS CONSCIOUS AND CAN THINK. HE LATER WORKED AT THE NATIONAL PHYSICAL LABORATORY, CREATING ONE OF THE FIRST DESIGNS FOR A STORED-PROGRAM COMPUTER, ALTHOUGH IT WAS NEVER ACTUALLY BUILT. • Easy to apply, except for short, atypical texts From Zanzibar to Zambia and Zaire, ozone zones make zebras run zany zigzags. ⇒ More sophistication required to mask statistical regularities. 39 / 59
  • 45. Introduction and Asymmetric Encryption History of Cryptography Homophonic substitution ciphers • To each a ∈ A, associate a set H(a) of strings of t symbols, where H(a), a ∈ A are pairwise disjoint. A homophonic substitution cipher replaces each a with a randomly chosen string from H(a). To decrypt a string c of t symbols, one must determine an a ∈ A such that c ∈ H(a). The key for the cipher is the sets H(a). • Example: A = {a, b}, H(a) = {00, 10}, and H(b) = {01, 11}. The plaintext ab encrypts to one of 0001, 0011, 1001, 1011. • Rational: makes frequency analysis more difficult. Cost: data expansion and more work for decryption. 40 / 59
  • 46. Introduction and Asymmetric Encryption History of Cryptography Polyalphabetic substitution ciphers • Idea (Leon Alberti): conceal distribution using family of mappings. • A polyalphabetic substitution cipher is a block cipher with block length t over alphabet A where: • the key space K consists of all ordered sets of t permutations over A, (p1 , p2 , . . . , pt ). • Encryption of m = m1 · · · mt under key e = (p1 , · · · , pt ) is Ee (m) = p1 (m1 ) · · · pt (mt ). • Decryption key for e is d = (p1 , · · · pt ). −1 −1 41 / 59
  • 47. Introduction and Asymmetric Encryption History of Cryptography Example: Vigen`re ciphers e • Key given by sequence of numbers e = e1 , . . . , et , where pi (a) = (a + ei ) mod n defining a permutation on an alphabet of size n. • Example: English (n = 26), with k = 3,7,10 m = THI SCI PHE RIS CER TAI NLY NOT SEC URE then Ee (m) = WOS VJS SOO UPC FLB WHS QSI QVD VLM XYO 42 / 59
  • 48. Introduction and Asymmetric Encryption History of Cryptography One-time pads (Vernam cipher) • A one-time pad is a cipher defined over {0, 1}. Message m1 · · · mn is encrypted by a binary key string k1 · · · kn . Ek1 ···kn (m1 · · · mn ) = (m1 ⊕ k1 ) · · · (mn ⊕ kn ) Dk1 ···kn (c1 · · · cn ) = (c1 ⊕ k1 ) · · · (cn ⊕ kn ) m = 010111 • Example: k = 110010 c = 100101 • Since every key sequence is equally likely, so is every plaintext! Unconditional (information theoretic) security, if key isn’t reused! • Moscow–Washington communication previously secured this way. • Problem? 43 / 59
  • 49. Introduction and Asymmetric Encryption History of Cryptography One-time pads (Vernam cipher) • A one-time pad is a cipher defined over {0, 1}. Message m1 · · · mn is encrypted by a binary key string k1 · · · kn . Ek1 ···kn (m1 · · · mn ) = (m1 ⊕ k1 ) · · · (mn ⊕ kn ) Dk1 ···kn (c1 · · · cn ) = (c1 ⊕ k1 ) · · · (cn ⊕ kn ) m = 010111 • Example: k = 110010 c = 100101 • Since every key sequence is equally likely, so is every plaintext! Unconditional (information theoretic) security, if key isn’t reused! • Moscow–Washington communication previously secured this way. • Problem? Securely exchanging and synchronizing long keys. 43 / 59
  • 50. Introduction and Asymmetric Encryption History of Cryptography Transposition ciphers • For block length t, let K be the set of permutations on {1, . . . , t}. For each e ∈ K and m ∈ M Ee (m) = me(1) me(2) · · · me(t) . • The set of all such transformations is called a transposition cipher. • To decrypt c = c1 c2 · · · ct compute Dd (c) = cd(1) cd(2) · · · cd(t) , where d is inverse permutation. • Letters unchanged so frequency analysis can be used to reveal if ciphertext is a transposition. Decrypt by exploiting frequency analysis for diphthongs, tripthongs, words, etc. 44 / 59
  • 51. Introduction and Asymmetric Encryption History of Cryptography Example: transposition ciphers • C = Aduaenttlydhatoiekounletmtoihahvsekeeeleeyqonouv 45 / 59
  • 52. Introduction and Asymmetric Encryption History of Cryptography Example: transposition ciphers • C = Aduaenttlydhatoiekounletmtoihahvsekeeeleeyqonouv A n d i n t h e e n d t h e l o v e y o u t a k e i s e q u a l t o t h e l o v e y o u m a k e Table defines a permutation on 1, ..., 50. 45 / 59
  • 53. Introduction and Asymmetric Encryption History of Cryptography Example: transposition ciphers • C = Aduaenttlydhatoiekounletmtoihahvsekeeeleeyqonouv A n d i n t h e e n d t h e l o v e y o u t a k e i s e q u a l t o t h e l o v e y o u m a k e Table defines a permutation on 1, ..., 50. • Idea goes back to Greek Scytale: wrap belt spirally around baton and write plaintext lengthwise on it. 45 / 59
  • 54. Introduction and Asymmetric Encryption History of Cryptography Composite ciphers • Ciphers based on just substitutions or transpositions are not secure • Ciphers can be combined. However . . . • two substitutions are really only one more complex substitution, • two transpositions are really only one transposition, • but a substitution followed by a transposition makes a new harder cipher. • Product ciphers chain substitution-transposition combinations. • Difficult to do by hand invention of cipher machines. 46 / 59
  • 55. Introduction and Asymmetric Encryption History of Cryptography ENIGMA Three-rotor German military Enigma machine Dayly keys are used and stored in a book. There are 10114 possibilities for one cipher. Other German Tricks A space was omitted or replaced by an X. The X was generally used as point or full stop. They replaced the comma by Y and the question sign by UD. The combination CH, as in ”Acht” (eight) or ”Richtung” (direction) were replaced by Q (AQT, RIQTUNG). 47 / 59
  • 56. Introduction and Asymmetric Encryption History of Cryptography Shannon’s Principle 1949 Confusion The purpose of confusion is to make the relation between the key and the ciphertext as complex as possible. Ciphers that do not offer much confusion (such as Vigenere cipher) are susceptible to frequency analysis. 48 / 59
  • 57. Introduction and Asymmetric Encryption History of Cryptography Shannon’s Principle 1949 Confusion The purpose of confusion is to make the relation between the key and the ciphertext as complex as possible. Ciphers that do not offer much confusion (such as Vigenere cipher) are susceptible to frequency analysis. Diffusion Diffusion spreads the influence of a single plaintext bit over many ciphertext bits. The best diffusing component is substitution (homophonic) 48 / 59
  • 58. Introduction and Asymmetric Encryption History of Cryptography Shannon’s Principle 1949 Confusion The purpose of confusion is to make the relation between the key and the ciphertext as complex as possible. Ciphers that do not offer much confusion (such as Vigenere cipher) are susceptible to frequency analysis. Diffusion Diffusion spreads the influence of a single plaintext bit over many ciphertext bits. The best diffusing component is substitution (homophonic) Principle A good cipher design uses Confusion and Diffusion together 48 / 59
  • 59. Introduction and Asymmetric Encryption Classical Asymmetric Encryptions Outline 1 Presentation 2 Motivations 3 History of Cryptography 4 Classical Asymmetric Encryptions 5 Conclusion 49 / 59
  • 60. Introduction and Asymmetric Encryption Classical Asymmetric Encryptions One-way function and Trapdoor Definition A function is One-way, if : • it is easy to compute • its inverse is hard to compute : r Pr[m ← {0, 1}∗ ; y := f (m) : f (A(y , f )) = y ] is negligible. Trapdoor: • Inverse is easy to compute given an additional information (an inverse key e.g. in RSA). 50 / 59
  • 61. Introduction and Asymmetric Encryption Classical Asymmetric Encryptions Integer Factoring → Use of algorithmically hard problems. Factorization • p, q → n = p.q easy (quadratic) • n = p.q → p, q difficult 51 / 59
  • 62. Introduction and Asymmetric Encryption Classical Asymmetric Encryptions RSA RSA function n = pq, p and q primes. e: public exponent • x → x e mod n easy (cubic) • y = xe → x mod n difficult x= yd where d = e −1 mod φ(n) Soundness Assume n = pq, gcd(e, φ(n)) = 1 and d = e − 1 mod φ(n). c d = mde = m.mkφ(n) mod n According to the Fermat Little Theorem ∀x ∈ (Z/nZ)∗ , x φ(n) = 1 52 / 59
  • 63. Introduction and Asymmetric Encryption Classical Asymmetric Encryptions Example RSA Example • p = 61 (destroy this after computing E and D) • q = 53 (destroy this after computing E and D) • n = pq = 3233 modulus (give this to others) • e = 17 public exponent (give this to others) • d = 2753 private exponent (keep this secret!) Your public key is (e, n) and your private key is d. encrypt(T ) = (T e ) mod n = (T 17 ) mod 3233 decrypt(C ) = (C d ) mod n(C 2753 ) mod 3233 • encrypt(123) = 12317 mod 3233 = 337587917446653715596592958817679803 mod 3233 = 855 53 / 59 • decrypt(855) = 8552753 mod 3233
  • 64. Introduction and Asymmetric Encryption Classical Asymmetric Encryptions Complexity Estimates Estimates for integer factoring Lenstra-Verheul 2000 Modulus Operations (bits) (log2 ) 512 58 1024 80 ≈ 260 years 2048 111 4096 149 8192 156 → Can be used for RSA too. 54 / 59
  • 65. Introduction and Asymmetric Encryption Classical Asymmetric Encryptions ElGamal Encryption Scheme Key generation: Alice chooses a prime number p and a group generator g of (Z/pZ)∗ and a ∈ (Z/(p − 1)Z)∗ . Public key: (p, g , h), where h = g a mod p. Private key: a Encryption: Bob chooses r ∈R (Z/(p − 1)Z)∗ and computes (u, v ) = (g r , Mhr ) v Decryption: Given (u, v ), Alice computes M ≡p ua r Justification: ua = Mh ≡p M v g ra Remarque: re-usage of the same random r leads to a security flaw: M1 h r M1 r ≡p M2 h M2 Practical Inconvenience: Cipher is twice as long as plain text. 55 / 59
  • 66. Introduction and Asymmetric Encryption Conclusion Outline 1 Presentation 2 Motivations 3 History of Cryptography 4 Classical Asymmetric Encryptions 5 Conclusion 56 / 59
  • 67. Introduction and Asymmetric Encryption Conclusion Summary Today • Presentation • Motivation • History of Cryptography • Classical Asymetric Encryption 57 / 59
  • 68. Introduction and Asymmetric Encryption Conclusion Next Time • Classical Symmetric Encryption • Security Notions • Examples 58 / 59
  • 69. Introduction and Asymmetric Encryption Conclusion Thank you for your attention Questions ? 59 / 59