cryptography and rsa algorithm

Post on 14-Aug-2015

40 Views

Category:

Education

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CRYPTOGRAPHY

Terminology :• Encryption :

• Decryption :

PLAIN TEXT

CIPHER TEXT

PLAIN TEXT

CIPHER TEXT

Vernam Cipher

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

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

Bob Alice

Message: hey alice

Message: hey alice

Alice’s key

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

Hello Alice!

6EB6957008E03CE4

Encrypt

Hello Alice!

Decrypt

Public key

Private key

Bob

Alice

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

Prerequisites :• Prime number

• Prime factorization

• Fermat’s little theorem

• Euler’s phi function

• Euler’s totient theorem

In 1970 british mathematician and scientist Clifford Cocks

came out with a one way fuction called as

“The Trapdoor”

ONE - WAY FUNCTION

Easy

Hard

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

me

mod N = ?

Easy

Harde

mod N = c

?

But what about the key

m mod N = ce

c mod N = md

m mod N = med

Prime factorization

9874563210123654789302145987698745632101236547893021459876987456321012365478930214598769874563210123654789302145987698745632101236547893021459876

9874563210123654789302145987698745632101236547893021459876987456321012365478930214598769874563210123654789302145987698745632101236547893021459876

P1=

P2=

98745632101236547893021459876987456321012365478930214598769874563210123654789302145987698745632101236547893021459876987456321012365478930214598769874563210123654789302145987698745632101236547893021459876987456321012365478930214598769874563210123654789302145987698745632101236547893021459876

N=

N=P1×P2

Eulers φ function

Φ(8)=

12345678

=4

Φ(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

But the problem is how to connect

Modular Exponentiation with

Eulers Φ Function

Eulers Theorem

m = 1 mod n

Φ(n)

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

m = m mod n

k*Φ(n)+1

m = m mod n e*d

k*Φ(n)+1

e*d

=

d = k*Φ(n)+1

Bibliography

• www.google.com

• www.wikepedia.com

• www.youtube.com

T H A N K

Y O U

top related