Princess Nora Bint Abdul Rahman University
College of Computer and Information Systems
Network and Data Communication Department
Network Security ( NET 536)
Sheet#4 ( Digital Signature)
Student Name: Student ID Section No
Question 1: In your opinion what will be better having a hash function that produce as fixedsize digest or variable-size digest? Support your answer?
A fixed-size digest is more feasible. A variable-size digest needs to be dependent on the length of the message, which makes applying the criteria more difficult and the function itself more involved.
Question 2: In what order should the signature function and the confidentiality function be applied to a message.
In Signature function, it uses the private key of the sender to sign ( encrypt hash) of the message and uses the public key of the sender by the receiver to verify(decrypt) the message.
In Confidentiality function ( cryptography), it uses the private key of the receiver by sender to encrypt the message and uses the public key of the reciever to decrypt the message.
Question 3: Give the digest ( hash code) knowing the hash algorithm specified below and the message:
The hash algorithm: take every third letter of the message (ignore punctuation), and convert the letter into a number (a=1, b=2…z=26). Add the numbers together.
Message: Hello, This is a sample message to demonstrate signatures.
12 +20 +19 +1 +13 +5 +19 +7 +15 +13 +19 +1 +19 +14 +21 +19
= 217 (therefore the hash value is 217)
Question 4: Illustrate the operation of RSA signature, given the following parameter p=3, q =11, e= 7, m =16. a.
Find the value of d, s.
N= p * q
N= 3 . 11= 33
Q= 2. 10= 20 e.d mod Q = 1
7 d mod 20 =1
7. 3 mod 20 =1
Princess Nora Bint Abdul Rahman University
College of Computer and Information Systems
Network and Data Communication Department
Network Security ( NET 536)
Sheet#4 ( Digital Signature)
21 mod 20 =1
d =3
S= m ^ d mod n
= 16 ^ 3 mod 33
S = 4 b.
Suppose Bob got a message and signature from Alice ( m=13, s=20) how can
Bob verified the message ?
M’ = 20 ^7 mod 33 =26
M’<>M
not verified
Question 4: Illustrate the operation of Elgamale Digital signature, given the following parameter : p = 7, g = 3, d = 2 , d’=5, m=3. Find the value of y,s,t.
Solution:
Y= 𝒈
S= 𝒈 𝒅 𝒎𝒐𝒅 𝒑 = 𝟑 𝟐 𝒎𝒐𝒅 𝟕 =2 𝒅′ 𝒎𝒐𝒅 𝒑 = 𝟑 𝟓 𝒎𝒐𝒅 𝟕 =5
T= 𝒅′ −𝟏 (𝒎 − 𝒅𝒔)𝒎𝒐𝒅 (𝒑 − 𝟏)
T = 𝟓′ −𝟏 (𝟑 − 𝟐 . 𝟓)𝒎𝒐𝒅 (𝟕 − 𝟏)
T= 𝟓′ −𝟏 (𝟑 − 𝟏𝟎)𝒎𝒐𝒅 (𝟔)
5T= 3 mod 6 – 10 mod 6
(5T+ 10) mod 6 = 3 mod 6
(5T+ 10) mod 6 = 3
T=1 because ( 5.1 + 10) mod 6= 15 mod 6
T= 3
Signature ( 5, 3)
Question 4: Illustrate the operation of DSA signature, given the following parameter: Prime p= 7; Prim divisor r= 3; g= 4; Private key d= 5; Session key d’= 2;
Message m= 3.
Find the value of y, s, t.
Y= 𝒈 𝒅 𝒎𝒐𝒅 𝒑 = 𝟒 𝟓 𝒎𝒐𝒅 𝟕 =2
S= (𝒈 𝒅′ (𝒎𝒐𝒅 𝒑) ) ( 𝒎𝒐𝒅 𝒓) = 𝟒 𝟐 𝒎𝒐𝒅 𝟏𝟏 ( 𝒎𝒐𝒅 𝟑) = 2
Princess Nora Bint Abdul Rahman University
College of Computer and Information Systems
Network and Data Communication Department
Network Security ( NET 536)
Sheet#4 ( Digital Signature)
T= 𝒅′ −𝟏 (𝒎 + 𝒅𝒔) (𝒎𝒐𝒅 𝒓)
T= 𝟐 −𝟏 (𝟑 + 𝟓 . 𝟐) ( 𝒎𝒐𝒅 𝟑)
2T= (3+ 10) ( mod 3)
2Tmod 3= 13 mod 3
2T mod 3= 1
Find T where the reminder of 9T / 3 = 1, start with T=1, 2, .. until the result = 1
2.1 mod 3 =2 mod 3= 2 !=1 so T!=1
2.2 mod 3 = 4 mod 3 = 1 ==1 so T=2
That’s is T=2