cryptography

29
Cryptography

Upload: ashish-chaudhary

Post on 28-Nov-2014

106 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Cryptography

Cryptography

Page 2: Cryptography

Cryptography

Cryptography is the art of achieving security by encoding messages to make them non readable.

Plain Text

Cipher Text

Encryption

Decryption

Key cryptography - study of encryption principles/methods cryptanalysis (code breaking) - the study of

principles/ methods of deciphering cipher text without knowing key

cryptology - the field of both cryptography and cryptanalysis

Page 3: Cryptography

Hello John

Encrypt

Ifmmp KpioInternet

Hello John

Decrypt

Ifmmp Kpio

Page 4: Cryptography

Cryptographic Techniques

Substitution Techniques. -- Caesar Cipher -- Modified version of Caesar Cipher -- Mono-alphabetic Cipher -- Homophonic Cipher -- Polygram Cipher -- Polyalphabetic Cipher

Page 5: Cryptography

with a shift of 3

Shift cipher (ceasar cipher)5

Page 6: Cryptography

monoalphabetic cipher6

Page 7: Cryptography

Homophonic Cipher

Page 8: Cryptography

Polygram Cipher

Page 9: Cryptography

Polyalphabetic cipherVigenère Tableau

9

Page 10: Cryptography

key: deceptivedeceptivedeceptive plaintext: wearediscoveredsaveyourself ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ

10

Page 11: Cryptography

Transposition Techniques. -- Rail Fence Technique -- Single Columnar Transposition

Technique --Single Columnar Transposition

Technique with multiple rounds -- Vernam Cipher(One time pad) -- Book Cipher

Page 12: Cryptography

Rail Fence Cipher

M e m a t r h t g p r y e t e f e t e o a a t MEMATRHTGPRYETEFETEOAAT

Write message on alternate rows, and read off cipher row by row

Page 13: Cryptography

Columnar Transposition Technique

Page 14: Cryptography

Vernam Cipher

Translate each plain text alphabet in to corresponding Number(i.e. A=0, B=1,…,Z=25)

Do same for each character input cipher text

Add plain text and one time pad

If the sum thus produced is greater than 26,subtract 26 from it.

Page 15: Cryptography

Cryptographic Mechanisms

Symmetric Key Cryptography Asymmetric Key Cryptography

Page 16: Cryptography

Symmetric Key Cryptography

Page 17: Cryptography

Diffie-Hellman Key Exchange Algorithm

P Q

Prime number ‘n’

Random number ‘x’ Calculate A as :- A=gx mod n

Computes the key K1 as:-

K1=Bx mod n

Prime number ‘g’

Random number ‘y’

Calculate B as:- B=gy mod n

Computes the key K2 as:-

K2=Ay mod n

Exchangen and g

ExchangeA and B

K1=K2

Page 18: Cryptography

For Example

P Q n=11

x=3 Calculate A as :-

A=73 mod 11

=343 mod 11

= 2

Computes the key K1 as:- K1=43 mod 11

= 64 mod 11

=9

g=7

y=6 Calculate B as:- B=76 mod 11 =117649 mod 11 =4

Computes the key K2 as:-

K2=26 mod 11 =64 mod 11 =9

Exchangen and g

ExchangeA and B

K1=K2

Page 19: Cryptography

Man in the Middle Attack(MITM)

Alice

Tom

Bob

n=11,g=7 x=3

n=11,g=7 x=8,y=6

n=11,g=7 y=9

Page 20: Cryptography

Continued..

Alice

Tom

Bob

A=73 mod 11=2

A=78 mod 11=9, B=76 mod 11=4

79 mod 11=8

Page 21: Cryptography

A=2

A=9

B=8

B=4

AliceTom Bob

Intercept

Intercept

A=2, B=4 A=2, B=8 A=9, B=8

Page 22: Cryptography

Continued..

Alice

Tom

Bob

A=2 , B=4

K1=43 mod 11=9

A=2, B=8

K1=88 mod 11=5

K2=26 mod 11=9

A=9 , B=8

K2=99 mod 11=5

Page 23: Cryptography

MITM attack is also known as: Bucket-brigade attack Fire brigade attack Monkey-in-the-middle attack Session hijacking TCP hijacking TCP session hijacking

Page 24: Cryptography

Asymmetric Key Cryptography

Page 25: Cryptography

RSA Algorithm

Choose two large prime numbers P and Q Calculate N=PxQ Select Public key E as not a factor of (P-

1)x(Q-1) Select Private key D as (DxE) mod (P-

1)x(Q-1)=1 For Encryption, CT=PTE mod N Send CT to the receiver For Decryption, PT=CTD mod N

Page 26: Cryptography

Digital Signature

Page 27: Cryptography

Message Digest

Page 28: Cryptography

MD5

Steps:1.) Padding2.) Append Length3.) Divide the input into 512-bit blocks4.) Initialize chaining variables5.) Process Blocks 5.1> copying chaining variables 5.2> Divide current 512 block into sub-

blocks 5.3> perform 4 rounds

Page 29: Cryptography

End of Chapter