RSA Public-Key Secrecy and Signature

Slides:



Advertisements
Similar presentations
Number Theory Algorithms and Cryptography Algorithms Prepared by John Reif, Ph.D. Analysis of Algorithms.
Advertisements

Cryptography and Network Security Chapter 9
RSA ( Rivest, Shamir, Adleman) Public Key Cryptosystem
Public Key Crytography1 From: Introduction to Algorithms Cormen, Leiserson and Rivest.
1 Cryptosystems Based on Discrete Logarithms. 2 Outline [1] Discrete Logarithm Problem [2] Algorithms for Discrete Logarithm –A trivial algorithm –Shanks’
Public Encryption: RSA
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
Chapter 3 Encryption Algorithms & Systems (Part C)
Chapter 9 – Public Key Cryptography and RSA Private-Key Cryptography  traditional private/secret/single key cryptography uses one key  shared by both.
Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
RSA Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013.
Algebra of RSA codes Yinduo Ma Tong Li. Ron Rivest, Adi Shamir and Leonard Adleman.
@Yuan Xue 285: Network Security CS 285 Network Security Digital Signature Yuan Xue Fall 2012.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
Page : 1 bfolieq.drw Technical University of Braunschweig IDA: Institute of Computer and Network Engineering  W. Adi 2011 Lecture-9 Public-Key Cryptography.
Page : 1 bfolieq.drw Technical University of Braunschweig IDA: Institute of Computer and Network Engineering  W. Adi 2011 Lecture-12 Public-Key Cryptography.
Page : 1 Date : Duration : 90 Minutes Maximum marks 70% Vorname ……………………………………….. Nachname ……………………………………….. Matrikel-Nr. ………………………………………..
Revision. Cryptography depends on some properties of prime numbers. One of these is that it is rather easy to generate large prime numbers, but much harder.
Public-Key Cryptography ElGamal Public-Key Crypto-System
Overview Modern public-key cryptosystems: RSA
Cryptographic Protocols Secret sharing, Threshold Security
Network Security Netzwerksicherheit Lecture ID: ET-IDA-082 and 111
Mathematical Background for Cryptography: Modular arithmetic and gcd
Rabin Lock and Public-Key Systems
A Realistic Secure Anonymous E-voting Protocol Based on ElGamal Scheme
Asymmetric-Key Cryptography
RSA Slides by Kent Seamons and Tim van der Horst
Public-Key Cryptography RSA Rivest-Shamir-Adelmann Public-Key System
第四章 數位簽章.
第四章 數位簽章.
RSA Preliminaries.
DH Public-Key Exchange
Section 4.6: Digital Signatures
Design Problems (Open book)
Cryptography.
Sample Solution Cryptology Design Fundamentals
Network Security Sample Solution Short questions (Closed book)
Mathematical Background: Prime Numbers
ElGamal Public-Key Systems over GF(p) & GF(2m)
Elliptic Curve Cryptography (ECC)
Mathematical Background: Primes and (GF)
Digital Signatures…!.
Bishop: Chapter 10 Key Management: Digital Signature
Lecture 6: Digital Signature
Key Distribution Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, /18/2019 Ref: Pfleeger96, Ch.4.
Cryptology Design Fundamentals
Cryptology Design Fundamentals
Cryptology Design Fundamentals
Cryptology Design Fundamentals
Cryptology Design Fundamentals
Cryptology Design Fundamentals
Cryptology Design Fundamentals
Sample Solution Cryptology Design Fundamentals
Sample Solution Final exam: Cryptology Design Fundamentals
Cryptology Design Fundamentals
Cryptology Design Fundamentals
Cryptology Design Fundamentals
Cryptology System Design Fundamentals
Cryptographic Protocols Secret Sharing, Threshold Security
Network Security Tutorial-14 Design Fundamentals IPSEC, KERBEROS
Cryptology Design Fundamentals
Network Security Tutorial-16 Design Fundamentals PGP ET-IDA-082
Elliptic-Curve Cryptography (ECC)
Network Security Tutorial-16 Design Fundamentals PGP ET-IDA-082
Network Security Tutorial-14 Design Fundamentals IPSEC, KERBEROS
Network Security Tutorial-17 Design Fundamentals E-Commerce ET-IDA-082
Cryptology Design Fundamentals
Public-Key Cryptography Quadratic Residues and „Rabin Lock“
Mathematical Background: Primes and (GF)
LAB 3: Digital Signature
Presentation transcript:

RSA Public-Key Secrecy and Signature Network Security Design Fundamentals ET-IDA-082 Tutorial-8 RSA Public-Key Secrecy and Signature 11.05.2016, v28 Prof. W. Adi

RSA Public Key Secrecy and Signature Design Summary for RSA Public Key Secrecy and Signature Open directory USER A: Na = pa . qa open modulus of A pa . qa tow secret large primes (Na) = (pa-1).(qa -1) Ea = open Encryption key of A Da = Ea-1 [mod (Na) ] USER B: Nb = pb . qb open modulus of B pb . qb tow secret large primes (Nb) = (pb-1).(qb -1) Eb = open Encryption key of B Db = Eb-1 [mod (Nb) ] User A Na Ea User B Nb Eb Y= M mod Nb (Encrypt) Eb gcd [Ea , (Na) ] = 1 gcd [ Eb , (Nb) ] = 1 A sends to B: Db Eb Db = M mod Nb =M (Decrypt) Y A signs Document M for B: M (M,S) Signed Message S Da Ea = M mod Na=M´ (Verify M´=M)? mod Na = S If M´= M then the signature is true Da Ea

Problem 8-1: Set up an RSA Public-key directory for two users A and B using the prime numbers 7,3 and 11,3 respectively User A Encrypts the message M=6 to get the cryptogram YA and singes YA to generate SA and sends both cryptogram YA and signature SA to B Let user B verify the signature of A and decrypt the message. Solution 8-1: User B Nb=33 Eb= 3 User A Na=21 Ea= 5 USER A: Na = pa . qa = 7x3=21 open modulus of A pa . qa = 7, 3 two secret primes (Na) = (pa-1).(qa -1)= (7-1)(3-1)=12 Ea = open Encryption key of A = 5 Da = Ea-1 [mod (Na) ] = 5-1 mod 12= 5 USER B: Nb = pb . qb = 11x3= 33 open modulus of B pb . qb = 11,3 two secret large primes (Nb) = (pb-1).(qb -1) = (3-1)(11-1)=20 Eb = open Encryption key of B = 3 Db = Eb-1 [mod (Nb) ] = 3-1 mod 20 =7 Open directory gcd [ Eb , (Nb) ] = 1 gcd [Ea , (Na) ] = 1, gcd [5,12) ] = 1 2. Encryption M=6 to B: YA =MEb mod Nb=(6)3 mod 33 = 18 Signing M=6 by A: SA =(YA )Da mod 21= (18)5 mod 21 = 9 = (YA, SA) = (18,9) is sent to B 3. Sinature verification by B: YA =(SA)Ea mod 21= (9)5 mod 21 = 18 = YA => A is authentic Decryption by B: M =YADb =(18)7 mod 33 = 6

Problem 8-2: Set up an RSA Public-key directory for two users A and B using the prime numbers 11,5 and 23,3 respectively. Use the open keys 7, 5 for A and B respectively.    User A encrypts the message M=2 to send the cryptogram YA to B and signs M to generate his signature SA . Compute YA and SA sent to B. 3. Decrypt the message at user’s B site and verify user’s A signature SA User B signs the received message and sends it back to A. Compute his signature SB. In 2, M can be computed by any other user by decrypting SA using the open Ea. Propose a possible solution to counteract that possibility and keep M secret. (Final exam 2004)

Solution 8-2: 1. System set up Open directory USER A: USER B: N = p . q = 11x5= 55 open modulus of A User A a a a N = p . q = 23x3= 69 open modulus of B b b b N =55 p . q = 23,3 two secret large primes p . q = 11,5 two secret primes a b b j a a E = 7 ( N ) = (p - 1).(q - 1) = (23 - 1)(3 - 1)=44 j ( N ) = (p - 1).( q - 1)= (11 - 1)(5 - 1)=40 a b b b a a a E = open Encryption key of B = 5 E = open Encryption key of A = 7 b a D = E - 1 [mod j ( N ) ] = 5 - 1 mod 44 = 9 User B D = E [mod j ( N ) ] = 7 mod 40= 23 b b b - 1 - 1 a a a N =69 gcd [E , j ( N ) ] = 1 b a a E = 5 gcd [ E , j ( N ) ] = 1 b b b 2. Encryption M=2 to B: Y =M Eb mod N =(2) 5 mod 69 = 32 A b Signing M=2 by A: S =(M) Da mod 55= (2) 23 mod 55 = 8 . (Y , S )= (32,8) is sent to B A A A 3. Decryption by B: M =Y Db =(32) 9 mod 69 = 2 A Signature verification by B: M =(S ) Ea mod 55= (8) 7 mod 55 = 2 = M => A is authentic A 4. Signing M=2 by B: S =(M) Db mod 69= (2) 9 mod 69 = 29 . (S )= 29 is sent to A B B 5. One possibility is to encrypt Sa as well using Eb. That is YSa=(Sa)Eb = 85 mod 69 = 13 . User B can then decrypt YSa to get the signature

Problem 8-3: A RSA system using the public modulus m=1243. The public encryption key was 27. It was possible through a security gap in the computer operating system to find out that Euler function is 1120. Compute the two prime factors p and q of m Break the system and decrypt a received cryptogram Y=7

Solution 8-3: (m) = (p -1)(q -1) = m-p-q+  s = (p + q) = m - (m) + 1 s = 1243-1120+1 = 124 m = p . q = 1243 p or q = ( s   s2 - 4 m ) / 2 = ( 124 +  1242 - 4 x 1243 ) / 2 p = 113, q = 11 2. Decryption if the open encryption key E = 27: D = E-1 mod (m) that is D = 27-1 (mod 1120) = 83 [27-1 is computed by the extended gcd algorithm gcd(1120,27)=1 ] => 27-1 = 83 M =YD =(7)83 mod 1243 = 662

Problem 8-4: A RSA cryptosystem with two users A and B having the secret prime number pairs for A: 13 and 7 and for B: 17 and 3 is used Find out the adequate open key of user A from the following list of integers: [21, 18, 11]. Compute the corresponding secret key for user A. Find out the adequate open key of user B from the following list of integers: [26,21,22]. Compute the corresponding secret key for user B. User B encrypts the message M=3, and send the resulting cryptogram YA to A. User B then signs the cryptogram YA and generates the signature SB . Compute YA and SB. Decipher the cryptogram YA on user A’s site and verify the Signature SB. User A signs the received message M and sends his signature SA back to B. Compute the signature SA. How many open keys are possible for each user? MH: Unterscheidet sich der Font auf dieser Folie absichtlich von den anderen? 8

Solution 8-4: Find out the adequate open key of user A from the following list of integers: [21, 18, 11]. Compute the corresponding secret key for user A. NA = 13 x 7 = 91 , φ (NA ) = (13-1)(7-1) = 72 gcd [ EA, φ (NA ) ] = 1 => select 11 as gcd (72,11) = 1 EA = 11 DA = -13 mod 72 = 59 (see computation below) DA = 35 -1 mod 72 = - 13 = 72-13 = 59 n1 n2 b1 b2 q r 72 11 1 6 -6 5 7 -13 2. Find out the adequate open key of user B from the following list of integers: [26,21,22]. Compute the corresponding secret key for user B. NB = 17 x 3 = 51 , φ (NB) = (17-1)(3-1) = 32 gcd (EB, φ (NB ) ] =1 => select 21 as gcd (32,21) = 1 EB = 21 DB = -3 mod 32 = 29 (see computation below) DB = 21 -1 mod 32 = - 3 = 32-3 = 29 n1 n2 b1 b2 q r 32 21 1 11 -1 10 2 3 -3 9

6. How many open keys are possible for each user? 3. User B encrypts the message M=3, and send the resulting cryptogram YA to A. User B then signs the cryptogram YA and generates the signature SB . Compute YA and SB. 4. Decipher the cryptogram YA on user A’s site and verify the Signature SB. Verification: Decryption: 5. User A signs the received message M and sends his signature SA back to B. Compute the signature SA. 6. How many open keys are possible for each user? # of keys for user A = φ [φ (NA )] = φ (72 ) = φ (2.2.2.3.3 )= 72 (1 -1/2 ) ( 1 – 1/3 ) = 24 keys # of keys for user B = φ [φ (NB )] = φ (32 ) = φ (25 )= 32 (1 -1/2 ) = 16 keys 10