0% found this document useful (0 votes)
27 views4 pages

Ex1 1

The document outlines various exercises related to cryptography and data security, including key space calculations, modular arithmetic, and encryption techniques. It covers topics such as the affine cipher, Vigenère cipher, and the use of Euler's phi function. Additionally, it includes practical problems for computing ciphertexts and understanding the security implications of different cryptographic methods.

Uploaded by

lehongnhung8520
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views4 pages

Ex1 1

The document outlines various exercises related to cryptography and data security, including key space calculations, modular arithmetic, and encryption techniques. It covers topics such as the affine cipher, Vigenère cipher, and the use of Euler's phi function. Additionally, it includes practical problems for computing ciphertexts and understanding the security implications of different cryptographic methods.

Uploaded by

lehongnhung8520
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

EXERCISE 1

INTRODUCTION TO CRYPTOGRAPHY AND DATA SECURITY

1. We consider a cryptosystem where users enter keys in the form of passwords. Assume a
password consisting of 8 letters, where each letter is encoded with the ASCII code (7 bits
per character, i.e., 128 possible characters).
(1) What is the size of the key space that can be constructed with such passwords?
(2) What is the corresponding key length in bits?
(3) Assuming most users only use the 26 lowercase letters from the alphabet instead of
the full 7 bits of the ASCII encoding, what is the corresponding key length in bits
in this case?
(4) What is the minimum number of characters needed for a password to generate a
key length of 128 bits, assuming:
(a) 7-bit characters?
(b) 26 lowercase letters from the alphabet?

2. Let X be a uniform random variable over the set {0, 1}n . Let Y be an arbitrary random
variable over the set {0, 1}n (not necessarily uniform) that is independent of X . Define the
random variable Z = X ⊕ Y . What is the probability that Z equals 0n ?

3. Assume you know the ciphertext of the message “attack at dawn” using one-time pad
encryption is
6c73d5240a948c86981bc294814d
(the plaintext is in 8-bit ASCII format and the ciphertext is written in hexadecimal). What
is the ciphertext of the message “attack at dusk” with the same OTP key?

4. Modular arithmetic is fundamental to many cryptosystems. We will practice some mod-


ular computations:
Compute the following results without a calculator:
(1) 15 · 29 mod 13
(2) 2 · 29 mod 13
(3) 2 · 3 mod 13
(4) −11 · 3 mod 13

5. Compute the following without a calculator:


(1) 1/5 mod 13
(2) 1/5 mod 7
(3) 2/5 mod 7
Date: September 25, 2024.
1
Introduction to Information Security Exercise 1
6.
(1) Construct the addition and multiplication tables for Z4 .
(2) Construct the addition and multiplication tables for Z5 .
(3) Construct the addition and multiplication tables for Z6 .
(4) Identify the elements in Z4 and Z6 that lack a multiplicative inverse. Explain why
a multiplicative inverse exists for all nonzero elements in Z5 .
7. What are the multiplicative inverses of 5 in Z11 , Z12 , and Z13 ? You can use trial-and-error
with a calculator or computer.
This simple problem highlights the crucial fact that the inverse of an integer in a given ring
depends entirely on the modulus. The extended Euclidean algorithm, introduced in Section
6.3, helps compute inverses efficiently.
8. Compute x as far as possible without a calculator. Use a smart decomposition of the
exponent as shown in the example in Section 1.4.1:
(1) x = 32 mod 13
(2) x = 72 mod 13
(3) x = 310 mod 13
(4) x = 7100 mod 13
(5) 7 x = 11 mod 13
The last problem is a discrete logarithm, a hard problem discussed in Chapter 8. The secu-
rity of many public-key schemes relies on the difficulty of solving the discrete logarithm for
large numbers, typically over 2000 bits.
9. Find all integers n with 0 < n < m that are relatively prime to m, for m = 4, 5, 9, 26.
The number of these integers is denoted by φ(m), e.g., φ(3) = 2. This function is called
“Euler” ’s phi function." What is φ(m) for m = 4, 5, 9, 26?
Further information on Euler’s phi function will be discussed in Section 6.3.

2
Introduction to Information Security Exercise 1
10. This problem deals with the affine cipher where the key is given as a = 7 and b = 22.
(1) Decrypt the text below:
falszztysyjzyjkywjrztyjztyynaryjkyswarztyegyyj

(2) Who wrote the line?

11. An obvious approach to increase the security of a symmetric algorithm is to apply the
same cipher twice, i.e.,
y = ek2 (ek1 (x))
As is often the case in cryptography, things can be tricky and results are often different from
the expected or desired ones. In this problem, we show that a double encryption with the
affine cipher is only as secure as single encryption! Assume two affine ciphers ek1 ≡ a1 x + b1
mod 26 and ek2 ≡ a2 x + b2 mod 26.
(1) Show that there is a single affine cipher ek3 ≡ a3 x + b3 mod 26 which performs
exactly the same encryption (and decryption) as the combination ek2 (ek1 (x)).
(2) Find the values for a3 , b3 when a1 = 3, b1 = 5 and a2 = 11, b2 = 7.
(3) To verify your solution,
(a) Encrypt the letter K with ek1 and the result with ek2 .
(b) Encrypt the letter K with ek3 .
(4) Briefly describe what happens if an exhaustive key-search attack is applied to a
double-encrypted affine ciphertext. Is the effective key space increased?
Remark: The issue of multiple encryption is of great practical importance in the case of
the Data Encryption Standard (DES), for which multiple encryption (in particular, triple
encryption) does increase security considerably, cf. Section 5.3.2.

12. We already know that the substitution cipher and the shift cipher can easily be broken
in little time. Let us now consider an extension of the shift cipher, namely the Vigenère
cipher (named after Blaise de Vigenère). Instead of using a single key k for the shift, it
uses l different shifts that are derived from a secret code word c. The code word consists
of l letters and has the form c = (c0 , c1 , . . . , cl−1 ). Each letter ci corresponds to a number
0, . . . , 25, which is given by its position in the alphabet. These numbers are the l shift
positions, which we denote by (k0 , k1 , . . . , kl−1 ).
Encryption (and decryption) work as follows: The first plaintext letter x 0 is cyclically shifted
by k0 positions, the second plaintext letter x 1 by k1 positions, and so on, until plaintext letter
x l−1 is shifted by kl−1 positions. From now on, the shift sequence repeats, i.e., plaintext x l
is again shifted by k0 positions, the next plaintext by k1 positions, and so on. This process
is expressed as:
y j ≡ x j + k( j mod l) (mod 26)
where x j denotes the j-th letter of the plaintext x = (x 0 , x 1 , . . .).
Since the cipher uses many ciphertext alphabets, it is called a polyalphabetic cipher.
(1) Assume the code word is given as c = JAMAIKA of size l = 7. Transform the code
word into the corresponding encryption keys ki . You can use Table 1.4 for this task.
3
Introduction to Information Security Exercise 1
(2) Use the table to encrypt the word x = CODEBREAKERS with the Vigenère cipher.
For each plaintext letter, choose the row with the corresponding shift value in the
leftmost column # and look up the shifted version of the plaintext.
(3) What do you think about the security of the Vigenère cipher? Propose an attack.

# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
2 C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
3 D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
4 E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
5 F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
6 G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
7 H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
8 I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
9 J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
10 K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
11 L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
12 M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
13 N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
14 O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
15 P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
16 Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
17 R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
18 S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
19 T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
20 U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
21 V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
22 W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
23 X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
24 Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
25 Z A B C D E F G H I J K L M N O P Q R S T U V W X Y

TABLE 1. Polyalphabetic substition table

You might also like