Top Banner
Cryptography “ You can’t make something secure if you don’t know how to break it” - Marc Weber Tobias
53
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Cryptology

Cryptography

“ You can’t make something secure if you don’t know how to break it”

- Marc Weber Tobias

Page 2: Cryptology

Definition• Cryptography is the science of

disguising messages so that only

the intended recipient can

decipher the received message.

• Secret Writing

Page 3: Cryptology

Scenario

Page 4: Cryptology

Terminologies • Plain text

• Cipher text

• Encryption

• Decryption

• Cryptanalysis

• Cryptology

Page 5: Cryptology
Page 6: Cryptology
Page 7: Cryptology

• Encryption: c = Ee(p)

• Decryption: p = Dd(c)

• Here p is a block of plaintext,

c is a block of ciphertext,

E is the encryption function, e is the encryption key,

D is the decryption function and d is the decryption key.

Cryptography

Page 8: Cryptology

Cryptanalysis

• Cryptography is the art and

science of creating secret codes.

• Cryptanalysis is the art and

science of breaking those code.

Page 9: Cryptology

Cryptanalysis Attack

Ciphertext Only

Brute-Force

Statistical

Pattern Known Plaintext

Chosen-Plaintext

Chosen-Ciphertext

Page 10: Cryptology

Crypto-

graphy

Crypt-analys

is

Cryptology

Page 11: Cryptology

Sym

metr

ic

Cip

hers

SubstitutionCipher

Mono-alphabetic

Polyalphabetic

TranspositionCipher

Page 12: Cryptology

Mono-alphabetic Cipher

• Additive / Caesar / Shift Cipher

• Multiplicative Cipher

• Affine Cipher

Page 13: Cryptology

Caesar Cipher

Page 14: Cryptology

Representation of Character

Page 15: Cryptology

Shift Cipher

• Encryptiono C=(P+K1) Mod 26

• Decryptiono P=(C-K1) Mod 26

https://www.youtube.com/watch?

v=fEULLhEA4Vk

Page 16: Cryptology

• The Additive cipher replaces each

alphabet in a text by the alphabet k

positions away (in the modulo 26

sense).

• For k = 3

W H A T I S Y O U R N A M E

becomes

Z K D W L V B R X U Q D P H

Page 17: Cryptology

Multiplicative Cipher

• Encryptiono C=(P * K1) Mod 26

• Decryptiono P=(C * K1

-1) Mod 26

Page 18: Cryptology

Affine Cipher

• Combination of Additive and

Multiplicative

• Encryptiono C=(P * K1 + K2) Mod 26

• Decryptiono P=((C – K2 )* K1

-1) Mod 26

Page 19: Cryptology

Cryptanalysis

• Brute-Force Attack

• Statistical Attack

• Frequency of Occurrence of letters.

(E,T,A,O,I,N,S,H,R,D……)

• Grouping of Di-gram (HE,IN,AN,IS...)

and Tri-grams (THE,ING,AND,HER…).

Page 20: Cryptology

Poly-alphabetic Cipher

• Each occurrence of character may

have a different substitution.

• One to Many

• Vigenere Cipher , Play-fair Cipher,

Hill Cipher ,Vernam Cipher.

Page 21: Cryptology

Vigenere Cipher

• Blaise de Vigenere, Mathematician

• Secret Key of length m (K1,K2.......,Km)

is required

• Key stream Not depend on plaintext

character.

• Encryption depends on the position of

character in the plaintext.

Page 22: Cryptology
Page 23: Cryptology

Example

• Plaintext : SHE IS LISTINING

• Key : PASCAL

• Cipher text : HHW KS

WXSLGNTCG

Page 24: Cryptology

Plaintext S H E I S L I S T I N I N G

P Values 18 07 04 08 18 11 08 18 19 04 13 08 13 06

K Values 15 00 18 02 00 11 15 05 08 02 00 11 05 00

C Values 07 07 22 10 18 22 23 23 11 06 13 19 02 06

Cipher text H H W K S W X X L G N T C G

Page 25: Cryptology

Plaintext S H E I S L I S T I N I N G

P Values 18 07 04 08 18 11 08 18 19 04 13 08 13 06

K Values 15 00 18 02 00 11 15 00 08 02 00 11 05 00

C Values 07 07 22 10 18 22 23 18 11 06 13 19 02 06

Cipher text H H W K S W X S L G N T C G

Page 26: Cryptology

Play-fair Cipher

• Used by British army during World war

I

• Secret key made of 25 alphabet

arranged in 5*5 Matrix.

• Two step process

oCreation of matrix

o Encryption

Page 27: Cryptology

Question (10 Marks)Dec -2012

Page 28: Cryptology

Solution• Plaintext : SHE IS LISTINING • Key : MORNING

M O R N I

G A B C D

E F H J K

L P Q S T

U V W X YZ

Page 29: Cryptology

Solution• SH EI SL IS TI NI NG • SH = QJ

H J

Q S

Page 30: Cryptology

Solution• SH EI SL IS TI NI NG • EI = KM

M O R N I

G A B C D

E F H J K

Page 31: Cryptology

Solution• SH EI SL IS TI NI NG • SL (SAME ROW)= TP

L P Q S T

Page 32: Cryptology

Solution• SH EI SL IS TI NI NG • IS = NT• TI(SAME COLUMN) = YD

M O R N I

G A B C D

E F H J K

L P Q S T

U V W X YZ

Page 33: Cryptology

Solution• SH EI SL IS TI NI NG • NI(SAME ROW) = IM• NG = MC

M O R N I

G A B C D

E F H J K

L P Q S T

U V W X YZ

Page 34: Cryptology

Hill Cipher

• Lester S. Hill

• Block Cipher

• Key is square matrix of order m*m

• Key Matrix need to have

multiplicative inverse.

• Difficult to break

Page 35: Cryptology

Example• Plain text = CATEncryption CAT = FIN

Decryption FIN = CAT

Page 36: Cryptology

One-Time Pad• Vernam Cipher.

• Key used once can not be reused.

• Key length is equal to message

length.

• Book cipher / Running Key cipher

Page 37: Cryptology

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

Numeric Code 21 04 17 13 00 12 02 08 15 07 04 17

Key 76 48 06 82 44 03 58 11 60 05 48 88

Sum 97 52 33 95 44 15 60 19 75 12 52 105

Mod 26 19 00 07 17 18 15 08 19 23 12 00 01

Ciphertext T A H R S P I T X M A B

Page 38: Cryptology

Book Cipher• Running Key cipher.

Page 39: Cryptology

Cipher

Block Cipher

Polygram Substitutio

n

Stream Cipher

Homophonic

Substitution

Page 40: Cryptology

Transposition

• Permutation of position of

Plaintext alphabet.

• Rail Fence Technique

• Simple Columnar Transposition

• Simple Columnar Transposition

with Multiple Round

Page 41: Cryptology

Cryptography

Encryption

Decryption

Page 42: Cryptology

CryptographyCreate secret Code

• Encryption

o CT = Ek (PT)

• Decryption

o PT=Dk (CT) = Dk (Ek (PT))

Page 43: Cryptology

Cryptography

• Input to the process o Algorithm

o Key

Page 44: Cryptology

Cryptography

Symmetric Key

Asymmetric Key

Page 45: Cryptology
Page 46: Cryptology

Symmetric Key

• Same key is used for encryption

and decryption of message.

• Key Exchange Problem

Page 47: Cryptology
Page 48: Cryptology

Diffie-Hellman Algorithm

1. Pick random, secret x

2. Compute A = gx mod n

3. Send A to Bob

4. K1 = Bx Mod n

1. Pick random, secret y

2. Compute B = gy mod n

3. Send B to Alice

4. K2 = Ay Mod n

Alice and Bob agree on two

prime number n and g

Page 49: Cryptology

Diffie – Hellman

K1 = (gx mod n)y = gxy mod n

K2 = (gy mod n)x = gxy mod n

• Let n = 11 and g = 7

• Let x = 3 and compute A

• Let y = 6 and compute B

• Calculate K1 and K2

Page 50: Cryptology

Solution

1. N = 11 , g = 7

2. x = 3 then A = 73 Mod 11 = 2

3. y = 6 then B = 76 Mod 11 = 4

4. K1 = 43 Mod 11 = 9

5. K2 = 26 Mod 11 = 9

Page 51: Cryptology

Problem with Algorithm

• Man in Middle attack

Page 52: Cryptology

Asymmetric Key

Page 53: Cryptology