Cryptography & Network Security : Topic Seminar Description & Analysis Madhava.N 1RV06SCN05 2 nd Semester M.Tech CNE RVCE RSA ALGORITHM.

Slides:



Advertisements
Similar presentations
Chapter 3 Public Key Cryptography and Message authentication.
Advertisements

CSE331: Introduction to Networks and Security Lecture 19 Fall 2002.
Public Key Encryption Algorithm
Dr. Lo’ai Tawalbeh Summer 2007 Chapter 9 – Public Key Cryptography and RSA Dr. Lo’ai Tawalbeh New York Institute of Technology (NYIT) Jordan’s Campus INCS.
Public Key Crytography1 From: Introduction to Algorithms Cormen, Leiserson and Rivest.
Public Encryption: RSA
Cryptography and Network Security Chapter 9. Chapter 9 – Public Key Cryptography and RSA Every Egyptian received two names, which were known respectively.
Public Key Cryptography and the RSA Algorithm
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
CSCE 790: Computer Network Security Chin-Tser Huang University of South Carolina.
Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender and receiver if this key is disclosed communications.
Dr.Saleem Al_Zoubi1 Cryptography and Network Security Third Edition by William Stallings Public Key Cryptography and RSA.
Public Key Algorithms 4/17/2017 M. Chatterjee.
1 Pertemuan 08 Public Key Cryptography Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
Public Key Cryptography RSA Diffie Hellman Key Management Based on slides by Dr. Lawrie Brown of the Australian Defence Force Academy, University College,
The RSA Algorithm JooSeok Song Tue.
“RSA”. RSA  by Rivest, Shamir & Adleman of MIT in 1977  best known & widely used public-key scheme  RSA is a block cipher, plain & cipher text are.
Introduction to Public Key Cryptography
Public Key Model 8. Cryptography part 2.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
The RSA Algorithm Based on the idea that factorization of integers into their prime factors is hard. ★ n=p . q, where p and q are distinct primes Proposed.
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
Prime Numbers Prime numbers only have divisors of 1 and self
Cryptography A little number theory Public/private key cryptography –Based on slides of William Stallings and Lawrie Brown.
Network and Communications Network Security Department of Computer Science Virginia Commonwealth University.
Public Key Cryptography and the RSA Algorithm Cryptography and Network Security by William Stallings Lecture slides by Lawrie Brown Edited by Dick Steflik.
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
Public-Key Cryptography CS110 Fall Conventional Encryption.
Improving Encryption Algorithms Betty Huang Computer Systems Lab
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Darci Miyashiro Math 480 April 29, 2013
Public-Key Encryption
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
1 Public-Key Cryptography and Message Authentication.
Computer and Network Security Rabie A. Ramadan Lecture 6.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
CS461/ECE422 Spring 2012 Nikita Borisov — UIUC1.  Text Chapters 2 and 21  Handbook of Applied Cryptography, Chapter 8 
The RSA Algorithm. Content Review of Encryption RSA An RSA example.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
PUBLIC KEY CRYPTOGRAPHY ALGORITHM Concept and Example 1IT352 | Network Security |Najwa AlGhamdi.
Cryptography and Network Security Public Key Cryptography and RSA.
Network Security Lecture 18 Presented by: Dr. Munam Ali Shah.
Chapter 3 – Public Key Cryptography and RSA (A). Private-Key Cryptography traditional private/secret/single-key cryptography uses one key shared by both.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
Public Key Cryptosystems RSA Diffie-Hellman Department of Computer Engineering Sharif University of Technology 3/8/2006.
Chapter 9 Public Key Cryptography and RSA. Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender.
Fall 2002CS 395: Computer Security1 Chapter 9: Public Key Cryptography.
Public Key Algorithms Lesson Introduction ●Modular arithmetic ●RSA ●Diffie-Hellman.
PUBLIC-KEY CRYPTOGRAPHY AND RSA – Chapter 9 PUBLIC-KEY CRYPTOGRAPHY AND RSA – Chapter 9 Principles Applications Requirements RSA Algorithm Description.
CS 4803 Fall 04 Public Key Algorithms. Modular Arithmetic n Public key algorithms are based on modular arithmetic. n Modular addition. n Modular multiplication.
Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy.
Lecture 3 (Chapter 9) Public-Key Cryptography and RSA Prepared by Dr. Lamiaa M. Elshenawy 1.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
Chapter 9 – Public Key Cryptography and RSA Every Egyptian received two names, which were known respectively as the true name and the good name, or the.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
CSEN 1001 Computer and Network Security Amr El Mougy Mouaz ElAbsawi.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
Visit for more Learning Resources
The RSA Algorithm JooSeok Song Tue.
Private-Key Cryptography
ICS 353: Design and Analysis of Algorithms
The RSA Algorithm JooSeok Song Tue.
Chapter -5 PUBLIC-KEY CRYPTOGRAPHY AND RSA
PUBLIC-KEY CRYPTOGRAPHY AND RSA – Chapter 9
The RSA Public-Key Encryption Algorithm
Presentation transcript:

Cryptography & Network Security : Topic Seminar Description & Analysis Madhava.N 1RV06SCN05 2 nd Semester M.Tech CNE RVCE RSA ALGORITHM

Agenda  What we already know?  Public Key Cryptosystems?  Overview of the Algorithm  Description of the Algorithm  RSA Key Setup  Analysis  Sample C Program  Examples & Exercises

What we already know? Cryptography is the science and art of designing ciphers Cryptanalysis is the science of breaking them A cryptosystem is a method of secret communication over public channels (key technology for protecting distributed systems) General cryptosystems Bob wants to send a msg x to Alice using an encryptor E such that y=xE Bob sends y to Alice who uses de decryptor D such that x = yD = (xE)D

Public Key Cryptosystems No need to share keys? 2 pairs of keys : public & private Public key known to all & Private known only the person of the public key owner Based on the idea of “TRAPDOOR” Defined as f : X -> Y f is one-to-one, easy to compute & is public f -1 is difficult to compute

Public Key Cryptosystems

Overview of the Algorithm  Initial paper on PKC by Diffie & Hellman [DIFF76b] in  Immediate response by Ron Rivest, Adi Shamir, & Len Adleman in 1977  Hence the name RSA  Paper first published in 1978 [RIVE78]  RSA scheme is a block cipher in which plaintext & ciphertext are integers between 0 & n-1 for some n  Best known & widely used public-key scheme

Some background on the Algorithm  Based on exponentiation in a finite field over integers modulo a prime  exponentiation takes O((log n) 3 ) operations (easy)  uses large integers (eg bits)  security due to cost of factoring large numbers  factorization takes O(e log n log log n ) operations (hard)

Some background on the Algorithm  Let a = (q * n) + r then :  r is the reminder, q is quotient, when we divide a by n  Examples of modulo Arithmetic  a = 11; n=7; then 11 = 1 * 7 + 4r = 4  a = -11; n=7; then11 = (-2) * 7 + 3r = 3

Description of the Algorithm Plaintext is encrypted in blocks, each block have a value < n Which mean block size is <= log 2 (n) Block size is 2 k bits. 2 k < n <= 2 k+1 To encrypt a message M the sender: obtains public key of recipient KU={e,N} computes: C=M e mod N, where 0≤M<N To decrypt the ciphertext C the owner: uses their private key KR={d,p,q} computes: M=C d mod N

Description of the Algorithm  Both sender & receiver know value of “n”  Sender knows the value of “e” and the receiver knows the value of “d”  Satisfactory Conditions  It is possible to find values of e, d, and n such that M ed = M mod n for all M < n  It is relatively easy to calculate M e and C d for all values of M < n  It is unfeasible to determine d given e and n

RSA Key Setup 1. Select 2 large prime numbers very large in magnitude say “p” & “q” 2. Calculate n = p * q 3. Calculate φ(n) = (p-1) * (q-1) 4. Select “e” such that it is relatively prime to φ(n) & e < φ(n) 5. Calculate “d” such that (e*d) – 1 mod φ(n) = 0 or d = e -1 mod φ(n) 6. Public Key : KU = {e,n} 7. Private Key:KR = {d,n}

RSA Key Setup  This key setup is done once (rarely) when a user establishes (or replaces) their public key.  The exponent e is usually fairly small, just must be relatively prime to ø(N).  Need to compute its inverse to find d. It is critically important that the private key KR={d,n} is kept secret, since if any part becomes known, the system can be broken.  Note that different users will have different moduli N

Analysis EULER’S TOTIENT FUNCTION φ(n) : No of non-negative integers less than “n” and relatively prime to “n” nφ(n)

Analysis  Euler’s Theorem a φ(n) = 1 mod n  a = 3; n=10; φ(10) = 4;3 4 = 81 = 1 mod 10  a = 2; n=11; φ(11) = 10;2 10 = 1024 = 1 mod 11  And its corollary represented as  For given 2 primes “p” & “q” with n = p * q, 0 < m < n  m φ(n)+1 = m (p-1)(q-1)+1 = m mod n  And alternative corollary  m kφ(n)+1 = m k(p-1)(q-1)+1 = m mod nfor some integer k

Analysis  Based on this Euler’s Theorem we can say that  ed = kφ(n) + 1OR  ed = 1 mod φ(n)&d = e -1 mod φ(n)  e & d are multiplicative inverses of each other

Sample C Program #include int me; int cd; int M[50],C[50],E,D,N,Z; int num,res,temp; int i,j,k,l; char data[50],enc[50],dec[50]; //Function to Calculate the Value of Decryption key “D” void getd(){ int x,res; for(D=1;D<Z;D++){ x=E*D; res=x-1; if(res%Z==0) break; } printf("\nD = %d\n",D); }

Sample C Program //Encryption Function C=M e mod N void memodn(){ me=M[i]; for(j=1;j<E;j++){ me=me*M[i]; me=me%N; } C[i]=me; } //Decryption Function M=C d mod N void cdmodn(){ cd=C[i]; for(j=1;j<D;j++){ cd=cd*C[i]; cd=cd%N; } M[i]=cd; }

Sample C Program void main(){ E=11,Z=60,N=77;//p=11q=7 //N=p * qZ = (p-1) * (q-1) getd(); printf("\nEnter The Message : "); gets(data); for(i=0,j=0;i<strlen(data);i++){ M[i]=(int)data[i]-50; memodn(); enc[i]=(char)(C[i]); } for(i=0,j=0;i<strlen(enc);i++){ C[i]=(int)enc[i]; cdmodn(); dec[i]=(char)(M[i]+50); } printf("\n\nEntered text = %s",data); printf("\n\n\t\tEncoded text = %s",enc); printf("\n\nDecoded text = %s",dec); }

Example  p = 7&q = 17  n = p * q => 7 * 17 => 119  φ(n) = (p – 1) * (q – 1) => 6 * 16 => 96  e is relatively prime to φ(n)e = 5  d chosen such that e * d = 1 mod 96d = 77 (77*5 = 4*96) + 1  KU = {5,119}  KR = {77,119}

Example

Exercise 1. p = 5, q = 11, e = 3, M = 9 Solution : C = M e mod n M = C d mod n n = p * q = 55&φ(55) = 40 d is chosen such that (e*d) – 1 mod φ(55) = 0, therefore d = 27 C = 9 3 mod 55=14 M = mod 55=9

Exercise 2. p = 7, q = 11, e = 17, M = 8 Solution : C = M e mod n M = C d mod n n = p * q = 77&φ(77) = 60 d is chosen such that (e*d) – 1 mod φ(77) = 0, therefore d = 53 C = 8 17 mod 55=57 M = mod 55=8

Exercise 3. p = 11, q = 13, e = 11, M = 7 Solution : C = M e mod n M = C d mod n n = p * q = 143&φ(143) = 120 d is chosen such that (e*d) – 1 mod φ(143) = 0, therefore d = 11 C = 7 11 mod 143=106 M = mod 143=7

Exercise 4. p = 17, q = 31, e = 7, M = 2 Solution : C = M e mod n M = C d mod n n = p * q = 527&φ(527) = 480 d is chosen such that (e*d) – 1 mod φ(527) = 0, therefore d = 343 C = 2 7 mod 527=128 M = mod 527=2

Exercise 5. Given C = 10, e=5, n=35 what is D? Solution : C = M e mod n M = C d mod n n=35 means that, φ(35) can be 24 (7-1) * (5-1) d is chosen such that (e*d) – 1 mod φ(35) = 0, therefore

Exercise 6. Given e = 31 and n=3599, what is the private key Solution : C = M e mod n M = C d mod n First we need to find the prime factors of 3599, then we calculate φ(3599) then from that we calculate D which will form the private key

QUESTIONS ?