A (Brief) History of Cryptography babaoglu/courses/security/lucidi/pdf/critto-storico-DES.pdf...

Click here to load reader

  • date post

    11-Jul-2020
  • Category

    Documents

  • view

    16
  • download

    0

Embed Size (px)

Transcript of A (Brief) History of Cryptography babaoglu/courses/security/lucidi/pdf/critto-storico-DES.pdf...

  • ALMA MATER STUDIORUM – UNIVERSITA’ DI BOLOGNA  

    A (Brief) History of Cryptography

    Ozalp Babaoglu

    © Babaoglu 2001-2020 Sicurezza

    ■ From the Greek  steganós (στεγανός) — “covered”, “concealed”, and -graphia (γραφή) — “writing”

    ■ The art of concealing information within other information ■ Form of “security through obscurity” ■ Can be made “keyless” ■ Real world examples:

    ■ Message written in secret ink on paper ■ Message written on the scalp of messenger

    Steganography

    2

    © Babaoglu 2001-2020 Sicurezza

    ■ Different steganography techniques depending on the type of “container” object: ■ Text steganography ■ Image steganography ■ Audio steganography ■ Video steganography ■ Network steganography

    Steganography

    3 © Babaoglu 2001-2020 Sicurezza

    ■ A substitution cipher ■ Each letter of the plaintext is replaced by a unique letter in the

    ciphertext ■ Which letter? ■ In the case of Caesar Cipher, the relation between the letter in the

    plaintext and that in the ciphertext is obtained through a cyclic left shift

    ■ Decryption is obtained through a cyclic right shift ■ Example: shift 3

    Caesar Cipher

    4

    abcdefghijklmnopqrstuvwxyz

    ABCDEFGHIJKLMNOPQRSTUVWXYZ C D

  • © Babaoglu 2001-2020 Sicurezza

    Caesar Cipher

    5

    ignavi coram morte quidem animam trahunt, audaces autem illam non saltem advertunt LJQDYLCFRUDPCPRUWHCTXLGHPCDQLPDPCWUDKXQWC CDXGDFHVCDXWHPCLOODPCQRQCVDOWHPCDGYHUWXQW

    ■ Number of positions to shift becomes the secret key of the cipher ■ Let pos(α) be the position of letter α in the alphabet, ■ Let chr( j) be the character in the j-th position of the alphabet, ■ Let k be the key, ■ Let mi and ci the i-th characters in the plaintext and ciphertext,

    respectively C(mi) = chr (pos(mi) + k) mod 26 D(ci) = chr (pos(ci) – k) mod 26

    © Babaoglu 2001-2020 Sicurezza

    Caesar Cipher

    ■ Trivial to carry out a brute-force attack because: ■ The encryption and decryption algorithms are known ■ The number of possible keys is very small (only 25 different keys) ■ The language of the plaintext is known and easily recognizable

    ■ Example: Cryptanalysis of “AJSN ANIN ANHN”

    6

    © Babaoglu 2001-2020 Sicurezza

    Caesar Cipher

    ■ Brute-force cryptanalysis of ciphertext “AJSN ANIN ANHN”

    Caesar(1) = zirm zmhm zmgm Caesar(2) = yhql ylgl ylfl Caesar(3) = xgpk xkfk xkek Caesar(4) = wfoj wjej wjdj Caesar(5) = veni vidi vici Caesar(6) = udmh uhch uhbh Caesar(7) = tclg tgbg tgag Caesar(8) = sbkf sfaf sfzf Caesar(9) = raje reze reye Caesar(10) = qzid qdyd qdxd

    … 7 © Babaoglu 2001-2020 Sicurezza

    Substitution Ciphers

    8

    ■ Instead of substituting letters through a cyclic shift, we can substitute them through a permutation of the alphabet, which becomes the key:

    abcdefghijklmnopqrstuvwxyz

    BFRULMZQWJEASOVKHXPGDTIYCN

    ■ For an alphabet of 26 letters, there are 26! possible keys since there are 26! possible permutations of 26 letters

    ■ Cryptanalysis through “brute force” becomes non practical ■ However, statistical cryptanalysis is still possible

  • © Babaoglu 2001-2020 Sicurezza

    Substitution Ciphers

    ■ Relative frequency of letters in English text

    9

    42 CHAPTER 2 / CLASSICAL ENCRYPTION TECHNIQUES

    proceed, we give a partial example here that is adapted from one in [SINK66]. The ciphertext to be solved is

    UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ

    As a first step, the relative frequency of the letters can be determined and compared to a standard frequency distribution for English, such as is shown in Figure 2.5 (based on [LEWA00]). If the message were long enough, this technique alone might be sufficient, but because this is a relatively short message, we cannot expect an exact match. In any case, the relative frequencies of the letters in the ciphertext (in percentages) are as follows:

    0

    2

    4

    6

    8

    10

    12

    14

    A

    8. 16

    7

    1. 49

    2

    2. 78

    2

    4. 25

    3

    12 .7

    02

    2. 22

    8

    2. 01

    5

    6. 09

    4 6 .9

    96

    0. 15

    3 0. 77

    2

    4. 02

    5

    2. 40

    6

    6. 74

    9 7. 50

    7

    1. 92

    9

    0. 09

    5

    5. 98

    7

    6. 32

    7

    9. 05

    6

    2. 75

    8

    0. 97

    8

    2. 36

    0

    0. 15

    0

    1. 97

    4

    0. 07

    4

    B C D E F G H I J K L M N

    R el

    at iv

    e fr

    eq ue

    nc y

    (% )

    O P Q R S T U V W X Y Z

    Figure 2.5 Relative Frequency of Letters in English Text

    P 13.33 H 5.83 F 3.33 B 1.67 C 0.00 Z 11.67 D 5.00 W 3.33 G 1.67 K 0.00 S 8.33 E 5.00 Q 2.50 Y 1.67 L 0.00 U 8.33 V 4.17 T 2.50 I 0.83 N 0.00 O 7.50 X 4.17 A 1.67 J 0.83 R 0.00 M 6.67

    a b c d e f g h i j k l m n o p q r s t u v w x y z © Babaoglu 2001-2020 Sicurezza

    Substitution Ciphers

    10

    ■ Consider the ciphertext UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ

    ■ Frequency of the letters in the ciphertext

    42 CHAPTER 2 / CLASSICAL ENCRYPTION TECHNIQUES

    proceed, we give a partial example here that is adapted from one in [SINK66]. The ciphertext to be solved is

    UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ

    As a first step, the relative frequency of the letters can be determined and compared to a standard frequency distribution for English, such as is shown in Figure 2.5 (based on [LEWA00]). If the message were long enough, this technique alone might be sufficient, but because this is a relatively short message, we cannot expect an exact match. In any case, the relative frequencies of the letters in the ciphertext (in percentages) are as follows:

    0

    2

    4

    6

    8

    10

    12

    14

    A

    8. 16

    7

    1. 49

    2

    2. 78

    2

    4. 25

    3

    12 .7

    02

    2. 22

    8

    2. 01

    5

    6. 09

    4 6 .9

    96

    0. 15

    3 0. 77

    2

    4. 02

    5

    2. 40

    6

    6. 74

    9 7. 50

    7

    1. 92

    9

    0. 09

    5

    5. 98

    7

    6. 32

    7

    9. 05

    6

    2. 75

    8

    0. 97

    8

    2. 36

    0

    0. 15

    0

    1. 97

    4

    0. 07

    4

    B C D E F G H I J K L M N R

    el at

    iv e

    fr eq

    ue nc

    y (%

    ) O P Q R S T U V W X Y Z

    Figure 2.5 Relative Frequency of Letters in English Text

    P 13.33 H 5.83 F 3.33 B 1.67 C 0.00 Z 11.67 D 5.00 W 3.33 G 1.67 K 0.00 S 8.33 E 5.00 Q 2.50 Y 1.67 L 0.00 U 8.33 V 4.17 T 2.50 I 0.83 N 0.00 O 7.50 X 4.17 A 1.67 J 0.83 R 0.00 M 6.67

    © Babaoglu 2001-2020 Sicurezza

    Substitution Ciphers

    ■ The two most-frequent cipher letters P and Z probably correspond to the two most-frequent plain letters e and t

    ■ Cipher letters S,U,O,M,H,D probably correspond to plain letters a,o,i,n,s,h

    ■ The least frequent cipher letters A,B,G,Y,I,J probably correspond to the least frequent plain letters v,k,j,x,q,z

    11 © Babaoglu 2001-2020 Sicurezza

    Substitution Ciphers

    ■ To resolve ambiguities, we can look at two-letter combinations ■ In ciphertext, the most common 2-letter sequence is ZW ■ In English language texts, the most common 2-letter sequence is

    th ■ So, Z is most likely t and W is h meaning P is e ■ Thus, the sequence ZWP in the ciphertext is probably the

    12

  • © Babaoglu 2001-2020 Sicurezza

    ciphertext JCDGHGCI... plaintext dadybeca... key k gcaigcaigcai...

    Polyalfabetic Ciphers

    ■ Use multiple substitution ciphers depending on the position of the letter in the plaintext

    13

    ■ Monoalfabetic for every | k | characters ■ Statistical attack still possible but becomes more difficult ■ Basis for “rotor machines” like Enigma and Purple that were used

    during world war 2

    a ABCDEFGHIJKLMNO.. b BCDEFGHIJKLMNO... c CDEFGHIJKLMNO... d DEFGHIJKLMNO... ... ... y YZABCDEFGHIJK... z ZABCDEFGHIJ...

    abcdefghijklmno...

    © Babaoglu 2001-2020 Sicurezza

    Secret-Key Cryptography Polyalfabetic Ciphers

    ■ Instead of substituting single letters of the plaintext, substitute blocks of letters

    ■ Example (blocks of 3) ■ AAA → SOM ■ AAB → PLW ■ ABA → RTQ ■ ABB → SLL ■ …

    ■ Doing so hides information regarding the frequency of single letters and pairs of letters

    14

    © Babaoglu 2001-2020 Sicurezza

    Secret-Key Cryptography Permutation Ciphers

    ■ Maintain the same letters in the ciphertext as in the plaintext, but change their order

    ■ For example,

    15

    attackp ostpone duntilt hreepmx

    plaintext

    Ciphertext:

    key4312567

    ttneaptetsuraodhcoipknlmpetx