Introduction to Cryptography – Final Exam 29 October 2023
University of Science & Technology 1st
Semester : 2023/2024
Ibb Branch Level : 3rd Level CySN
Faculty of Computing & IT Duration : 2 Hours
CySN Program Lecturer : Dr. Redhwan Q. Shaddad
Answer all the following questions:
Q1. [10 Marks] For a multiplication encryption, if the number of distinct letters is 𝑛 = 155:
a) Which one key (𝐾) of the following keys is suitable for this system:
( 24 - 5 - 31 )
b) If the plaintext 𝑝 = 13, find the ciphertext 𝑐 (just as a value).
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
c) Find the inverse key 𝐾 −1 .
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
Page 1 of 5
SAMPLE001
Introduction to Cryptography – Final Exam 29 October 2023
University of Science & Technology 1st
Semester : 2023/2024
Ibb Branch Level : 3rd Level CySN
Faculty of Computing & IT Lecturer : Dr. Redhwan Q. Shaddad
Q2. [10 Marks] In Transport Encryption (on level of bit), if input data is given as:
𝟏𝟎𝟏𝟎 𝟏𝟏𝟎𝟎 𝟎𝟎𝟏𝟏 𝟎𝟏𝟎𝟏 𝟎𝟎𝟎𝟎 𝟏𝟎𝟎𝟎
and the permutation box (P-box) is given as:
24 9 1 2 3 4 13 5
4 10 5 6 7 8 14 17
8 11 17 18 19 20 15 21
20 12 21 22 23 24 16 1
a) What is the type of the P-box?
(Normal transport box – Extended transport box – Compressed transport box)
b) Find the output of this box.
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
c) Write a program code for a function which receive an input data to this box and generate the output
data. Define any variable you can use it and explain it in comment.
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
Page 2 of 5
SAMPLE001
Introduction to Cryptography – Final Exam 29 October 2023
University of Science & Technology 1st
Semester : 2023/2024
Ibb Branch Level : 3rd Level CySN
Faculty of Computing & IT Lecturer : Dr. Redhwan Q. Shaddad
Q3. [10 Marks] Suppose there are 2 users: Alice and Bob. They want to communicate securely using RSA
encryption algorithm. If this encryption system implemented on the following letters:
A B C D E F G H I J K
0 1 2 3 4 5 6 7 8 9 10
L M N O P Q R S T U V
11 12 13 14 15 16 17 18 19 20 21
W X Y Z 0 1 2 3 4 5 6
22 23 24 25 26 27 28 29 30 31 32
7 8 9 + / * & % # @ Space
33 34 35 36 37 38 39 40 41 42 43
$ ! ~ : < > { } [ ] ?
44 45 46 47 48 49 50 51 52 53 54
a) How Alice generates her own public and private keys; show that step-by-step. Assume that Alice selects
𝑒 = 23.
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
b) If Alice wants to send the message “DR” to Bobe with authentication criteria, what is the encryption
rule and the ciphertext?
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
c) If Bob wants to send a message to Alice with confidentiality, write only the encryption rule.
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
Page 3 of 5
SAMPLE001
Introduction to Cryptography – Final Exam 29 October 2023
University of Science & Technology 1st
Semester : 2023/2024
Ibb Branch Level : 3rd Level CySN
Faculty of Computing & IT Lecturer : Dr. Redhwan Q. Shaddad
Q4. [10 Marks] In DES, the input into the S-Boxes is given as:
𝟏𝟏𝟎𝟏 𝟎𝟏𝟏𝟎 𝟏𝟏𝟎𝟎 𝟏𝟎𝟏𝟎 𝟏𝟏𝟏𝟏 𝟎𝟏𝟎𝟏 𝟏𝟏𝟏𝟎 𝟎𝟎𝟏𝟎 𝟎𝟎𝟎𝟏 𝟎𝟎𝟏𝟏 𝟏𝟏𝟎𝟏 𝟎𝟏𝟎𝟎
This function processes the main encryption for DES as shown in
the side figure. Find the outputs of substitution boxes (S-Boxes), if
you consider all S-Boxes has the same values as given in the
following table.
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
Page 4 of 5
SAMPLE001
Introduction to Cryptography – Final Exam 29 October 2023
University of Science & Technology 1st
Semester : 2023/2024
Ibb Branch Level : 3rd Level CySN
Faculty of Computing & IT Lecturer : Dr. Redhwan Q. Shaddad
Q5. [10 Marks] A hashing system is given as the following figure:
If the initial hashing value is 𝐻0 = 1010110001010011 and the transport function has the following
permutation box P-Box:
11 12 13 4
14 15 3 7
16 2 6 9
1 5 8 10
Find the Hash code for the following message:
𝑴𝒆𝒔𝒔𝒂𝒈𝒆 = 𝟎𝟎𝟏𝟏 𝟏𝟏𝟎𝟎 𝟏𝟏𝟏𝟎 𝟎𝟏𝟎𝟎 𝟎𝟏𝟏𝟏 𝟏𝟏𝟎𝟏 𝟎𝟏𝟎𝟏 𝟏𝟎𝟎𝟏
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………
Good Luck
Page 5 of 5
SAMPLE001