eec 688/788 secure and dependable computing lecture 4 wenbing zhao department of electrical and...

31
EEC 688/788 EEC 688/788 Secure and Dependable Secure and Dependable Computing Computing Lecture 4 Lecture 4 Wenbing Zhao Wenbing Zhao Department of Electrical and Computer Department of Electrical and Computer Engineering Engineering Cleveland State University Cleveland State University [email protected] [email protected]

Post on 19-Dec-2015

220 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

EEC 688/788EEC 688/788Secure and Dependable ComputingSecure and Dependable Computing

Lecture 4Lecture 4

Wenbing ZhaoWenbing ZhaoDepartment of Electrical and Computer EngineeringDepartment of Electrical and Computer Engineering

Cleveland State UniversityCleveland State University

[email protected]@ieee.org

Page 2: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

22

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

OutlineOutline

• Introduction to cryptography– Terminology– Basic encryption methods– Characteristics of "Good" Ciphers

Page 3: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

33

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Cryptography TerminologyCryptography Terminology

• Encryption is the process of encoding a message so that its meaning is not obvious– Equivalent terms: encode, encipher

• Decryption is the reverse process, transforming an encrypted message back into its normal, original form – Equivalent terms: decode, decipher

• Plaintext: message to be encrypted• Ciphertext: encrypted message

Page 4: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

44

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Cryptography TerminologyCryptography Terminology

• The cryptosystem involves a set of rules for how to encrypt the plaintext and how to decrypt the ciphertext

• Why encryption? – It addresses the need for confidentiality of data, also

helps to ensure integrity– It forms the basis of protocols that enable us to

provide security while accomplishing system or network tasks

Page 5: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

55

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Cryptography TerminologyCryptography Terminology

• The encryption and decryption rules are called encryption and decryption algorithms

• Encryption/decryptions algorithms often use a device called a key, denoted by K, so that the resulting ciphertext depends on the original plaintext message, the algorithm, and the key value

• An encryption scheme that does not require the use of a key is called a keyless cipher

Page 6: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

66

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Symmetric EncryptionSymmetric Encryption• The encryption and decryption keys are the

same, so P = D(K, E(K,P))• D and E are closely related. They are mirror-

image processes• The symmetric systems provide a two-way

channel to their users• The symmetry of this situation is a major

advantage of this type of encryption, but it also leads to a problem: key distribution

Page 7: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

77

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Symmetric EncryptionSymmetric Encryption• DK(EK(P)) = P

Page 8: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

88

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Asymmetric EncryptionAsymmetric Encryption

• Encryption and decryption keys come in pairs. The decryption key, KD, inverts the encryption of key KE, so that P = D(KD, E(KE,P))

• Asymmetric encryption systems excel at key management

Page 9: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

99

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

CryptologyCryptology

• Cryptology is the research into and study of encryption and decryption; it includes both cryptography and cryptanalysis

• Cryptography – art of devising ciphers – Comes from Greek words for “secret writing”. It refers

to the practice of using encryption to conceal text

• Cryptanalysis – art of breaking ciphers – Study of encryption and encrypted messages, hoping to

find the hidden meanings

Page 10: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

1010

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

CryptanalysisCryptanalysis• Attempt to break a single message• Attempt to recognize patterns in encrypted

messages, to be able to break subsequent ones • Attempt to deduce the key, in order to break

subsequent messages easily• Attempt to find weaknesses in the implementation

or environment of use of encryption• Attempt to find general weaknesses in an

encryption algorithm

Page 11: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

1111

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

CryptanalysisCryptanalysis

• Traffic analysis: attempt to infer some meaning without even breaking the encryption, e.g.,– Noticing an unusual frequency of communication– Determining something by whether the communication

was short or long

Page 12: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

1212

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Basic Encryption MethodsBasic Encryption Methods

• Substitution ciphers: one letter is exchanged for another

• Transposition ciphers: order of letters is rearranged

Page 13: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

1313

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Substitution CiphersSubstitution Ciphers

• Idea: each letter or group of letters is replaced by another letter or group of letters

• Caesar cipher – circularly shift by 3 letters– a -> D, b -> E, … z -> C– More generally, shift by k letters, k is the key

• Monoalphabetic cipher – map each letter to some other letter– A b c d e f … w x y z– Q W E R T Y … V B N M <= the key

Page 14: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

1414

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Cryptanalysis of Substitution Ciphers Cryptanalysis of Substitution Ciphers

• Brute force cryptanalysis would have to try 26! permutations of a particular ciphertext message

• Smarter way: use frequencies of letters, pairs of letter etc., or by guessing a probable word or phrase. Most frequently occurred– Letters: e, t, o, a, n, …– Digrams: th, in, er, re, an, …– Trigrams: the, ing, and, ion, ent– Words: the, of, and, to, a, in, that, …

• When messages are long enough, the frequency distribution analysis quickly betrays many of the letters of the plaintext

Page 15: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

1515

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Transposition CiphersTransposition Ciphers

• Substitution cipher – preserves order of plaintext symbols but disguises them

• Transposition cipher – reorders (rearrange) symbols but does not disguise them. It is also called permutation

• With transposition, the cryptography aims for– Widely spreading the information from the message or

the key across the ciphertext– Transpositions try to break established patterns

Page 16: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

1616

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Columnar TranspositionColumnar Transposition

• Plaintext written in rows, number of columns = key length

• Key is used to number the columns

• Ciphertext read out by columns, starting with column whose key letter is lowest

Page 17: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

1717

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Columnar TranspositionColumnar Transposition

• A transposition cipher example

Page 18: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

1818

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

One-Time PadsOne-Time Pads• One-time pad: construct an unbreakable cipher

– Choose a random bit string as the key– Convert the plaintext into a bit string– Compute the XOR of these two strings, bit by bit– The resulting ciphertext cannot be broken, because in

a sufficiently large sample of ciphertext, each letter will occur equally often, as will every digram, every trigram, and so on

=> There is simply no information in the message because all possible plaintexts of the given length are equally likely

Page 19: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

1919

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

The Vernam CipherThe Vernam Cipher• The Vernam Cipher is a type of one-time pad devised by

Gilbert Vernam for AT&T

Page 20: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

2020

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

The Vernam CipherThe Vernam Cipher

• The encryption involves an arbitrarily long nonrepeating sequence of numbers that are combined with the plaintext

• Assume that the alphabetic letters correspond to their counterparts in arithmetic notation mod 26 – That is, the letters are represented with numbers 0

through 25

• To use the Vernam cipher, we sum this numerical representation with a stream of random two-digit numbers

Page 21: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

2121

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

The Vernam Cipher - ExampleThe Vernam Cipher - Example

Plaintext V E R N A M C I P H E R

Numeric Equivalent

21

4 17

13

0 12

2 8 15

7 4 17

+ Random Number

76

48

16

82

44

3 58

11

60

5 47

88

= Sum 97

52

33

95

44

15

60

19

75

12

51

105

= mod 26 19

0 7 17

18

15

8 19

23

12

25

1

Ciphertext t a h r s p i t x m z b

Page 22: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

2222

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

The Vernam Cipher - ObservationsThe Vernam Cipher - Observations• The repeated letter t comes from different

plaintext letters• Duplicate ciphertext letters are generally

unrelated when this encryption algorithm is used => there is no information in the message to be exploited

Page 23: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

2323

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

The Vernam Cipher - DecryptionThe Vernam Cipher - Decryption

• To decrypt: (Ci – Ki) mod 26– Note on rules of mod on negative number: “The

mod function is defined as the amount by which a number exceeds the largest integer multiple of the divisor that is not greater than that number” (http://mathforum.org/library/drmath/view/52343.html)

– Modula op always return non-negative number– E.g., (19-76) mod 26 = (-57) mod 26 = (-78+21)

mod 26 = 21

Page 24: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

2424

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

The Vernam Cipher - DecryptionThe Vernam Cipher - Decryption

Ciphertext t a h r s p i t x m z b

Numeric equivalent 19 0 7 17 18 15 8 19 23 12 25 1

- One-time pad 76 48 16 82 44 3 58 11 60 5 47 88

= Difference -57 -48 -9 -65 -26 12 -50 8 -37 7 -22 -87

= mod 26 21 4 17 13 0 12 2 8 15 7 4 17

Plaintext V E R N A M C I P H E R

Page 25: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

2525

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

One-Time PadsOne-Time Pads

• Disadvantages– The key cannot be memorized, both sender

and receiver must carry a written copy with them

– Total amount of data can be transmitted is limited by the amount of key available

– Sensitive to lost or inserted characters

Page 26: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

2626

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Characteristics of "Good" CiphersCharacteristics of "Good" Ciphers-- -- Claude Shannon (1949)Claude Shannon (1949)

• The amount of secrecy needed should determine the amount of labor appropriate for the encryption and decryption

• The set of keys and the enciphering algorithm should be free from complexity

• The implementation of the process should be as simple as possible

• Errors in ciphering should not propagate and cause corruption of further information in the message

• The size of the enciphered text should be no larger than the text of the original message

Page 27: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

2727

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Shannon's Shannon's Characteristics of "Good" CiphersCharacteristics of "Good" Ciphers

• The amount of secrecy needed should determine the amount of labor appropriate for the encryption and decryption– Even a simple cipher may be strong enough

to deter the casual interceptor or to hold off any interceptor for a short time

Page 28: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

2828

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Shannon's Shannon's Characteristics of "Good" CiphersCharacteristics of "Good" Ciphers

• The set of keys and the enciphering algorithm should be free from complexity– We should restrict neither the choice of keys

nor the types of plaintext on which the algorithm can work

– For example, an algorithm that works only on plaintext having an equal number of As and Es is useless

Page 29: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

2929

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Shannon's Shannon's Characteristics of "Good" CiphersCharacteristics of "Good" Ciphers

• Errors in ciphering should not propagate and cause corruption of further information in the message– One error early in the process should not

throw off the entire remaining ciphertext

Page 30: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

3030

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Shannon's Shannon's Characteristics of "Good" CiphersCharacteristics of "Good" Ciphers

• The size of the enciphered text should be no larger than the text of the original message – A ciphertext that expands dramatically in size

cannot possibly carry more information than the plaintext, yet it gives the cryptanalyst more data from which to infer a pattern

– A longer ciphertext implies more space for storage and more time to communicate

Page 31: EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

3131

Spring 2009Spring 2009 EEC688: Secure & Dependable ComputingEEC688: Secure & Dependable Computing Wenbing ZhaoWenbing Zhao

Properties of "Trustworthy" Properties of "Trustworthy" Encryption Systems Encryption Systems

• It is based on sound mathematics

• It has been analyzed by competent experts and found to be sound

• It has stood the "test of time"