Top Banner
CRYPTOGRAPHY
25

Cryptography and RSA algorithm

Aug 14, 2015

Download

Education

Saifil Momin
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: Cryptography and RSA algorithm

CRYPTOGRAPHY

Page 2: Cryptography and RSA algorithm

Terminology :• Encryption :

• Decryption :

PLAIN TEXT

CIPHER TEXT

PLAIN TEXT

CIPHER TEXT

Page 3: Cryptography and RSA algorithm

Vernam Cipher

Page 4: Cryptography and RSA algorithm

H O W A R E Y O U

7 14 22 0 17 4 24 14 20

Plain text

One time pad

N C B T Z Q A R X

13 2 1 19 25 16 0 17 23

Total 20 16 23 19 42 20 24 31 43

20 16 23 19 16 20 24 5 17Subtract

U Q X T Q U Y F RCipher text

Page 5: Cryptography and RSA algorithm

Private-key Cryptography :

• Same key is used to encrypt and decrypt the message

• Sender and the recipient(receiver) of the message must agree on a common key

• It is symmetric Cryptography, parties are equal

• Hence does not protect sender from receiver forging a message & claiming is sent by sender

Page 6: Cryptography and RSA algorithm

Bob Alice

Message: hey alice

Message: hey alice

Alice’s key

Page 7: Cryptography and RSA algorithm

Public-key Cryptography :

• Public-key cryptography involves the use of two keys:

• A Public-key, which may be known by anybody, and can be used to encrypt messages, and verify signatures

• A Private-key, known only to the recipient(receiver), used to decrypt messages, and sign(create) signatures

Page 8: Cryptography and RSA algorithm

Hello Alice!

6EB6957008E03CE4

Encrypt

Hello Alice!

Decrypt

Public key

Private key

Bob

Alice

Page 9: Cryptography and RSA algorithm

RSA Algorithm :• RSA stands for Ron Rivest , Adi Shamir and Leonard Adleman, who first publicly described it in 1977

• It allows anyone in the communication network to encrypt and send message

• N=pq, where p & q are two distinct primes

• Random positive integer ‘e’ called enciphering exponent must satisfying gcd(e, Ø(n))=1

• Pair (n,e) are made public

Page 10: Cryptography and RSA algorithm

Prerequisites :• Prime number

• Prime factorization

• Fermat’s little theorem

• Euler’s phi function

• Euler’s totient theorem

Page 11: Cryptography and RSA algorithm

In 1970 british mathematician and scientist Clifford Cocks

came out with a one way fuction called as

“The Trapdoor”

Page 12: Cryptography and RSA algorithm

ONE - WAY FUNCTION

Easy

Hard

Page 13: Cryptography and RSA algorithm

For this Clifford Cocks took help of Modular Exponentiation

46 Mod 12 = 101

23

4

5

6

7891

0

11

12

13

14

15

1617

3 mod 17 =

12543

Page 14: Cryptography and RSA algorithm

me

mod N = ?

Easy

Harde

mod N = c

?

Page 15: Cryptography and RSA algorithm

But what about the key

m mod N = ce

c mod N = md

m mod N = med

Page 16: Cryptography and RSA algorithm

Prime factorization

Page 17: Cryptography and RSA algorithm

9874563210123654789302145987698745632101236547893021459876987456321012365478930214598769874563210123654789302145987698745632101236547893021459876

9874563210123654789302145987698745632101236547893021459876987456321012365478930214598769874563210123654789302145987698745632101236547893021459876

P1=

P2=

98745632101236547893021459876987456321012365478930214598769874563210123654789302145987698745632101236547893021459876987456321012365478930214598769874563210123654789302145987698745632101236547893021459876987456321012365478930214598769874563210123654789302145987698745632101236547893021459876

N=

N=P1×P2

Page 18: Cryptography and RSA algorithm

Eulers φ function

Φ(8)=

12345678

=4

Page 19: Cryptography and RSA algorithm

Φ(A)= A-1

Eg. Φ(7)=6

Where A is a prime number

Φ(A×B) = (A-1)×(B-1)

Eg. Φ(7×11) = (7-1)×(11-1)= 60

Page 20: Cryptography and RSA algorithm

But the problem is how to connect

Modular Exponentiation with

Eulers Φ Function

Page 21: Cryptography and RSA algorithm

Eulers Theorem

m = 1 mod n

Φ(n)

Page 22: Cryptography and RSA algorithm

Lets make some modifications in the Eulers theorem

m = 1 mod n

Φ(n)

1 =1k

m = 1 mod n

k×Φ(n)

1×m=m m×m = m mod n

k×Φ(n)

m = m mod n

k×Φ(n)+1

Page 23: Cryptography and RSA algorithm

m = m mod n

k*Φ(n)+1

m = m mod n e*d

k*Φ(n)+1

e*d

=

d = k*Φ(n)+1

Page 24: Cryptography and RSA algorithm

Bibliography

• www.google.com

• www.wikepedia.com

• www.youtube.com

Page 25: Cryptography and RSA algorithm

T H A N K

Y O U