Discrete Maths 2003 Lecture 36 3 Slides Pp

Embed Size (px)

Citation preview

  • 8/13/2019 Discrete Maths 2003 Lecture 36 3 Slides Pp

    1/5

    Lecture 36, 17-October-200Discrete Mathematics 2003

    1

    Introduction to Cryptography This work is based loosely on Chapter 12

    (Number Theory) of the text

    Security is very important in IT, and a key aspect

    of this isprivacy (or confidentiality) e.g. incredit card transactions on the internet

    We want secure communication, where only thesender & receiver of a message can understand it

    This is achieved by encrypting (or enciphering)the message at the sender site, & decrypting (ordeciphering) it at the receiver site

    Hopefully, an intruder who obtains the encryptedmessage is unable to understand its contents

    2

    Caesars Cipher A very early example of encryption is due to

    Julius Caesar (10044 BC)

    We call data that is not encryptedplaintext(orcleartext), while encrypted data is ciphertext

    Caesar encrypted his messages using the table

    Plaintext 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 zCiphertext D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

    Thus discrete is encrypted as GLVFUHWH, andSULYDFB is decrypted asprivacy

    This cipher is termed a monoalphabetic cipher,

    since each plaintext letter is always encrypted bythe same ciphertext letter

    3

    Caesars Cipher (continued)

    This example of Caesars cipher involves a shiftof each letter of the alphabet by 3 positions

    There is nothing particularly significant about theuse of 3 we could have shifted each letter by 7

    positions, or 19 positions, etc Altogether, there are 26 different ciphers that can

    be constructed using Caesars approach(including the trivial cipher)

    They can be described in the following way

    Suppose our cipher involves a shift of each letterby spositions

  • 8/13/2019 Discrete Maths 2003 Lecture 36 3 Slides Pp

    2/5

    Lecture 36, 17-October-200Discrete Mathematics 2003

    4

    Caesars Cipher (continued) Identify a with 1, b with 2, c with 3, , x with

    24, y with 25, and z with 0

    To encipher a plaintext letter:

    1. Encode the letter as its corresponding number

    2. Add s to the number

    3. If the result is 25, translate it back to a letter

    4. If the result is 26, divide it by 26, andtranslate the remainderback to a letter

    Examples: Encipher the letters b and x usingCaesars cipher with a shift of 6 positions

    Because of Step 2 above, the Caesar ciphers areknown as additive ciphers

    5

    Multiplicative Ciphers A cipher can also be obtained by multiplication

    by a number t, as follows

    To encipher a plaintext letter:

    1. Encode the letter as its corresponding number

    2. Multiply the number by t

    3. Use the remainder when this number isdivided by 26, and translate it back to a letter

    If t= 2, we obtain

    Plaintext 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 zCiphertext B D F H J L N P R T V X Z B D F H J L N P R T V X Z

    Note this is nota useful cipher, as the messageLRN could mean fig,fit,sit, etc

    6

    Multiplicative Ciphers (cont)

    The multiplicative cipher with t= 2 isnt usefulbecause we need to be able to reconstruct theplaintext uniquely from the ciphertext

    However, if t= 3, we do obtain a useful cipher

    Plaintext 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 zCiphertext C F I L O R U X A D G J M P S V Y B E H K N Q T W Z

    It can be checked that valid multiplicative ciphersare obtained if t= 1 (the trivial cipher), 3, 5, 7, 9,11, 15, 17, 19, 21, 23 and 25 so there are 12multiplicative ciphers

  • 8/13/2019 Discrete Maths 2003 Lecture 36 3 Slides Pp

    3/5

  • 8/13/2019 Discrete Maths 2003 Lecture 36 3 Slides Pp

    4/5

    Lecture 36, 17-October-200Discrete Mathematics 2003

    10

    Diagram of Secret Key Encryption

    (Diagram from Foundations of Computer Scienceby

    Behrouz A. Forouzan, Brooks/Cole, 2003, p. 308)

    11

    Data Encryption Standard (DES)

    Secret key encryption has been used for morethan 2000 years

    At first the algorithms were simple, and the keyswere easy to guess

    Today, the algorithms are very sophisticated

    The most common method nowadays is theDataEncryption Standard(DES), developed in the1970s (essentially by IBM)

    The method, in which data is scrambled in a very

    complicated fashion, is used widely, particularlyin banking

    12

    DES (continued)

    In DES, the data is transformed into a string of

    bits (e.g. use ASCII code), which is broken into

    segments of 64 bits

    Each segment is then encrypted in a many-stageprocess that uses a 56-bit key

    The DES method is a monoalphabetic cipher,

    since, for a given key, each particular 64-bit

    plaintext segment is always encrypted as the

    same 64-bit ciphertext string

  • 8/13/2019 Discrete Maths 2003 Lecture 36 3 Slides Pp

    5/5

    Lecture 36, 17-October-200Discrete Mathematics 2003

    13

    Secret Key Algorithms

    Secret key algorithms are usually efficient theytake less time to implement than the alternativepublic key algorithms well discuss shortly

    So secret key encryption is especially useful forlong messages

    However, there are 2 disadvantages

    Firstly, each pair of users must have a secret key so, if npeople are to use secret key encryption,there must be n (n 1)/2 secret keys

    Thus, for 1 million people to communicate, thereneeds to be about half-a-trillion secret keys!

    14

    Disadvantages of Secret Key

    Encryption

    So the first disadvantage of secret key encryption

    relates to the managementof the secret keys.

    That is, how can so many keys be kept secret?

    The second disadvantage is associated with the

    distribution of the keys i.e. how does the sender

    securely inform the receiver what the key is?

    These 2 disadvantages of secret key encryption

    are addressed in public key encryption, which

    well introduce in the next lecture