29
Chapter 2 Cryptography

Chap2 Cryptography

Embed Size (px)

Citation preview

Page 1: Chap2 Cryptography

Chapter 2

Cryptography

Page 2: Chap2 Cryptography

Authentication

What is authentication? Verification of identity of someone who

generated some data Relates to identity verification classifications of identity verification:

by something known e.g. password by something possessed e.g. smart card,

passport by physical characteristics (biometrics) e.g.

finger prints, palm prints, retina, voice by a result of involuntary action : signature

Page 3: Chap2 Cryptography

Authentication Requirements – must be able to verify

that: Message came from apparent source or

author Contents have not been altered Sometimes, it was sent at a certain time

or sequence Protection against active attack

(falsification of data and transactions)

Page 4: Chap2 Cryptography

Password Protection of passwords

Don’t inform your password to anybody Don’t write or login your password at everywhere Etc.

Choosing a good password Criteria:

Hard to guess and easy to remember Characteristics of a good password

Not shorter than six characters Not patterns from the keyboard Etc.

Calculations on password Password population, N =rs

Probability of guessing a password = 1/N Probability of success, P=nt/N

Page 5: Chap2 Cryptography

Techniques for guessing passwords

• Try default passwords.• Try all short words, 1 to 3 characters

long.• Try all the words in an electronic

dictionary(60,000).• Collect information about the user’s

hobbies, family names, birthday, etc.• Try user’s phone number, social security

number, street address, etc.• Try all license plate numbers (MUP103).• Use a Trojan horse• Tap the line between a remote user and

the host system.

Page 6: Chap2 Cryptography

Password Selecting Strategies

User education Computer-generated

passwords Reactive password checking Proactive password checking

Page 7: Chap2 Cryptography

Example 1

Based on the passwords given below, determine which passwords are good or bad, include one reason for each password : iswara01 9kelisa01 pskjwM opps queen anita

Page 8: Chap2 Cryptography

Example 2

Assume you choose character from a-z and 0-9 and the number of characters required are 5. Determine how much time will be needed to get the right password if your capability of your computer is 400 MIPS. Give your opinion/conclusion from this problem.

Page 9: Chap2 Cryptography

Solutionr = 26 (a-z) + 10 (0-9) = 36 , P = 1 , s = 5N = rs   = 365   = 6.05 x 107 P = nt/Nn = 400 x 107 /secTherefore: t = PN/n = 1 x ( 6.05 x 107 ) / (400 x 106) /sec = o.0151 = 1.51 x 10-2

Conclusion: the password can be broke only least than one second, means this password is not secured and not a good password.

Page 10: Chap2 Cryptography

Cryptography Classified along three independent

dimensions: The type of operations used for

transforming plaintext to ciphertext The number of keys used

symmetric (single key, or private-key encryption)

asymmetric (two-keys, or public-key encryption)

The way in which the plaintext is processed

Page 11: Chap2 Cryptography

Cryptography Algorithms Symmetric algorithms P=D(K,E(K,P))

Asymmetric algorithms P=D(Kd, E(Ke, P))

Page 12: Chap2 Cryptography

Symmetric Cryptography Principles

An encryption scheme has five ingredients: Plaintext Encryption algorithm Secret Key Ciphertext Decryption algorithm

Security depends on the secrecy of the key, not the secrecy of the algorithm

Page 13: Chap2 Cryptography

Symmetric Cryptography Principles

Page 14: Chap2 Cryptography

Public-Key Cryptography Principles

The use of two keys has consequences in: key distribution, confidentiality and authentication.

The scheme has six ingredients Plaintext Encryption algorithm Public key Private key Ciphertext Decryption algorithm

Page 15: Chap2 Cryptography

Encryption using Public-Key system

Page 16: Chap2 Cryptography

Decryption using Public-Key System

Page 17: Chap2 Cryptography

Applications for Public-Key Cryptosystems

Three categories: Encryption/decryption: The sender

encrypts a message with the recipient’s public key.

Digital signature: The sender ”signs” a message with its private key.

Key echange: Two sides cooperate two exhange a session key.

Page 18: Chap2 Cryptography

Methods use in Cryptography Algorithm Substitution

monoalphabetic substitution Formed by shifting the letters of the original alphabet

polyalphabetic substitution Extension of monoalphabetic substitution system Using Vigenere Tableau

Transposition unkeyed transposition

Rearrange letters by using matrix keyed transposition

Rearrange letters by using matrix where the size of matrix is determined by the length of the key used.

Page 19: Chap2 Cryptography

Example: Monoalphabetic Substitution Cipher

Based on the keys below, change this plaintext “ failure is the only opportunity to begin again more intelligently” to ciphertext. Use 5-letter words.

Plaintext Alphabet 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 Key f g h i j k I m n o p q r s t u v w x y z a b c d e

Page 20: Chap2 Cryptography

SolutionPlaintext: “Failure is the only opportunity to begin again more intelligently”

Page 21: Chap2 Cryptography

Example: Polyalphabetic Substitution Cipher

Based on Figure 2.2 in the notes, get the ciphertext for the plaintext “A minutes success pays the failure of years” in 4-letter words and “failure” as the repeating key. Use ‘x’ to pad out the blanks.

Page 22: Chap2 Cryptography

Figure 2.2

Page 23: Chap2 Cryptography

Solution

Plaintext: “A minutes success pays the failure of years”

Page 24: Chap2 Cryptography

Example: Unkeyed Single Transposition

Encrypt the plaintext : “there is no security on this earth there is only opportunity” into a matrix of 5 (rows) by 10 (columns).

Get the ciphertext horizontally, using 5- letter words.

Page 25: Chap2 Cryptography

SolutionPlaintext: “There is no security on this earth there is only opportunity”

Ciphertext:

THERE ISNOS ECURI TYONT HISEA RTHTH EREIS ONLYO PPORT UNITY

Page 26: Chap2 Cryptography

Example: Keyed Single Transposition

With the key “security”, encrypt the plaintext “ignorance is the mother of admiration” using keyed single transposition into 4-letter words. Use “x” to pad out columns.

Page 27: Chap2 Cryptography

SolutionPlaintext: “ignorance is the mother of admiration”

Ciphertext:

ietm ihig nser arto rhot ifea nmao ndoc

Page 28: Chap2 Cryptography

Classification of ciphers (transformation) Stream ciphers

they convert one symbol of plaintext immediately into a symbol of ciphertext

depends on symbol, key and control information of encipherment algorithm

Block ciphers encrypt a group of plaintext symbols as one

block examples are transposition ciphers

e.g, in columnar transposition, the entire message is translated as one block, block size need not have any particular relationship to the size of the character

Page 29: Chap2 Cryptography

Puzzle of the Day Some programs use passwords for access

control, but do not protect the passwords in a very sophisticated manner or make determining the correct password very easy. The argument for using simple passwords and weak encipherment is that the data or programs being protected are of little value and the passwords give a small measure of privacy.

Given that what they are protecting is truly of little value, why is the use of such simple passwords and easily-broken encipherment bad?