0% found this document useful (0 votes)
44 views

CSS Assignment One Solutions

This document contains an assignment with 5 questions related to computer security systems. The questions cover topics like secure key exchange algorithms, public key cryptography, RSA encryption, Diffie-Hellman key exchange, and HMAC implementation. For each question, there is a detailed step-by-step answer explaining the concepts and calculations. The document emphasizes doing your best and feeling free to ask the teacher assistant any questions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

CSS Assignment One Solutions

This document contains an assignment with 5 questions related to computer security systems. The questions cover topics like secure key exchange algorithms, public key cryptography, RSA encryption, Diffie-Hellman key exchange, and HMAC implementation. For each question, there is a detailed step-by-step answer explaining the concepts and calculations. The document emphasizes doing your best and feeling free to ask the teacher assistant any questions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Kingdom of Saudi Arabia

‫المملكة العربية السعودية‬


Ministry of Education
‫وزارة التعليم‬
Umm AlQura University
‫جامعة أم القرى‬
Adham University College
‫الكلية الجامعية بأضم‬
Computer Science Department
‫قسم الحاسب اآلل‬

Second Semester of 2017/ 2018 Academic Year


Computer Security Systems Course, 6803532-3 -Assignment 1-

Last Delivery Date Tuesday, 18/06/1439 H – 06/03/2018

Question One: 1 Mark


Choose the best answer:
1.If Alice and Bob need a secure method for public exchange of a secret key, which algorithm is the best for
them?
a) RSA
b) Diffie-Hellman
c) Digital Signature
d) RC4

Question Two: 1 Mark


Put True if the statement is true, and put False if the statement is false, with the correction for the false
statements:
1.In the CCM, we use two different keys for encryption and Mac. ( False )
In CCM, single key is used for both encryption & MAC.
2.In public key cryptography, we use the private key for encrypting the messages and creating the signatures.
( False )
In public key cryptography, we use the private key for decrypting the messages and signing or creating the
signatures.

1
Kingdom of Saudi Arabia
‫المملكة العربية السعودية‬
Ministry of Education
‫وزارة التعليم‬
Umm AlQura University
‫جامعة أم القرى‬
Adham University College
‫الكلية الجامعية بأضم‬
Computer Science Department
‫قسم الحاسب اآلل‬

Question Three: 1 Mark


In a public-key system using RSA, you intercept the ciphertext C =10 sent to a user whose public key is e=5,
n=35.
a. What is the plaintext M?
Answer of Question Three:
We know that the ciphertext C = 10, and the public key PU = {e, n} = {5, 35}.
Based on Euler’s Totient function, (n) is defined as the number of positive integers less than n and relatively
prime to n [textbook: “Cryptography and Network Security”, page 240]. We could find that (n) = 24.

Now, we guess two prime numbers p and q. Let p be 5 and q be 7. All the following conditions will be satisfied
based on the guess:
(1) n = p*q = 5*7=35
(2) (n) = (p-1)(q-1)=(5-1)(7-1)=4*6=24
(3) gcd((n), e) = gcd(24, 5) =1, 1< e < (n)

We calculate d in the next step. Based on RSA key generation algorithm,


d ≡ e-1 mod (n) which is equivalent to
ed ≡ 1 mod (n)
or ed mod (n) =1. (chapter 9.1 page 269)

We have e = 5, (n) = 24. So, 5d mod 24 =1, and d = 5.

Now, we find the private key PR = {d, n} = {5, 35}.

Based on RSA decryption algorithm,


M = Cd mod n
= 105 mod 35
=5

We also can verify the correctness by the RSA encryption algorithm as the following:
C = Me mod n = 55 mod 35 = 10

Therefore, we conclude that the plaintext M is 5.

2
Kingdom of Saudi Arabia
‫المملكة العربية السعودية‬
Ministry of Education
‫وزارة التعليم‬
Umm AlQura University
‫جامعة أم القرى‬
Adham University College
‫الكلية الجامعية بأضم‬
Computer Science Department
‫قسم الحاسب اآلل‬

Question Four: 1 Mark


Consider a Diffie-Hellman scheme with a common prime q = 11 and a primitive root α = 2.
a. If user A has public key YA = 9, what is A’s private key XA?
b. If user B has public key YB = 3, what is the shared secret key K?
Answer of Question Four:
a.
q = 11, α = 2, YA = 9
YA = α xA mod q
9 = 2 xA mod 11

2^1 mod 11 = 2
2^2 mod 11 = 4
2^3 mod 11 = 8
2^4 mod 11 = 5
2^5 mod 11 = 10
2^6 mod 11 = 9

Therefore xA = 6

b.
KAB = axA.xB mod q
= yAxB mod q (which B can compute)
= yBxA mod q (which A can compute)
= 36 mod 11 = 3

Therefore K(Shared Secret Key) = 3

3
Kingdom of Saudi Arabia
‫المملكة العربية السعودية‬
Ministry of Education
‫وزارة التعليم‬
Umm AlQura University
‫جامعة أم القرى‬
Adham University College
‫الكلية الجامعية بأضم‬
Computer Science Department
‫قسم الحاسب اآلل‬

Question Five: 1 Mark


The following figure shows an alternative means of implementing HMAC.
a. Describe the operation of this implementation by using an equation.

Answer of Question Five:


It can be simply described by this equation:
𝐇𝐌𝐀𝐂𝐊(𝐌) = 𝐅[𝐅[(𝐊 + 𝐗𝐎𝐑 𝐨𝐩𝐚𝐝), 𝐈𝐕] || 𝐇𝐚𝐬𝐡[𝐅[(𝐊 + 𝐗𝐎𝐑 𝐢𝐩𝐚𝐝), 𝐈𝐕] || 𝐌)] ]

Remember, “Success is 1% inspiration and 99% perspiration”


Do your Best 😉
If you have any questions, feel free to ask me through my email
T.Mariah Sami Ahmed Khayat
Teacher Assistant @ Adam University College
[email protected]

You might also like