You are on page 1of 6

Question 01.

1. What are Prime Numbers? Why are they seen as an important part of
asymmetric cryptography?
A prime number is a positive integer greater than 1 that has no positive integer
divisors other than 1 and itself. For example, the first six prime numbers are 2, 3, 5,
7, 11, and 13.

In the field of cryptography, prime numbers play a crucial role in the security of
certain encryption algorithms. Asymmetric cryptography, also known as public-key
cryptography, relies on the fact that certain mathematical operations are much easier
to perform in one direction than the other. For example, it is relatively easy to
multiply two large prime numbers together, but it is much more difficult to determine
the prime factors of a large composite number (a number that is not prime). This
property is used in certain types of encryption algorithms, such as the widely used
RSA algorithm, to create a secure communication channel.

Question 02.

2. Briefly describe the mathematical concepts involved in Prime Factorization


and GCD mathematical notions.

Prime factorization is the process of expressing a positive integer as a product of its


prime factors. For example, the prime factorization of 15 is 3 x 5, because 15 can be
evenly divided by neither 2 nor any other number except for 3 and 5.

The greatest common divisor (GCD), also known as the greatest common factor
(GCF) or highest common factor (HCF), is the largest positive integer that divides
two or more numbers without a remainder. For example, the GCD of 8 and 12 is 4,
because 4 is the largest positive integer that divides both 8 and 12 without a
remainder.

To find the GCD of two numbers, a common method is to use the Euclidean
algorithm, which is an efficient method for finding the GCD of two numbers. The
Euclidean algorithm works by repeatedly applying the division algorithm (dividing one
number by the other and taking the remainder) until the remainder is 0. The last non-
zero remainder is the GCD of the two numbers.
For example, to find the GCD of 8 and 12:

8/12 = 0 remainder 8

12/8 = 1 remainder 4

8/4 = 2 remainder 0

Therefore, the GCD of 8 and 12 is 4.

The Euclidean algorithm can also be extended to find the GCD of more than two
numbers. In this case, the GCD is found by repeatedly applying the Euclidean
algorithm to the current GCD and the next number in the list until all numbers have
been processed.

The GCD has several important properties and applications in mathematics,


including in number theory, algebra, and geometry. It is also a fundamental concept
in computer science and is used in a variety of algorithms and data structures.

Question 03.

3. What is Primality Testing necessary for the asymmetric key generation


process of the RSA algorithm?
The security of communication in the RSA algorithm is based on the difficulty of
factoring large composite numbers, which are used as keys in the encryption and
decryption process. As a result, the ability to generate large composite numbers that
are difficult to factor is critical.
One method is to multiply two large prime numbers together to produce a composite
number. However, simply selecting two large numbers and assuming they are prime
is insufficient. To ensure that the numbers are truly prime, a primality testing
algorithm can be used to validate their primality.
Algorithms for determining whether a given number is prime or composite are known
as primality testing algorithms. There are various primality testing algorithms, ranging
from simple deterministic to more complex probabilistic algorithms.
It is critical in the context of the RSA algorithm to use a reliable primality testing
algorithm to ensure that the composite numbers used as keys are indeed prime. This
is because if a composite number is used as a key, an attacker may be able to factor
the number and discover the prime factors, compromising the communication's
security.
Therefore, primality testing is an important step in the key generation process of the
RSA algorithm, as it ensures that the keys used in the algorithm are actually prime
and therefore difficult to factor.

Question 04.

4. Provide differences between symmetric and asymmetric key cryptographic


algorithms.
Symmetric and asymmetric key cryptographic algorithms are two main types of
encryption algorithms used to secure communication and protect data. The primary
distinction between these two types of algorithms is how they use keys to encrypt
and decrypt messages.
There are a number of other differences between symmetric and asymmetric key
algorithms, including:
Performance: Because they use the same key for both encryption and decryption,
symmetric key algorithms are generally faster and more efficient than asymmetric
key algorithms. Because they use two different keys, asymmetric key algorithms
require more computational resources to encrypt and decrypt messages.
Key Management: To communicate securely in a symmetric key system, both the
sender and the recipient must have the same key. This means that the key must be
securely exchanged between the two parties before communication can begin.
Because the public key is available to anyone in an asymmetric key system, key
exchange is not required. The private key, on the other hand, must be always kept
secret and secure.
Security: Because they use two different keys for encryption and decryption,
asymmetric key algorithms are thought to be more secure than symmetric key
algorithms. If the key in a symmetric key system is compromised, the security of the
communication can be jeopardized. The security of communication in an asymmetric
key system is not dependent on the secrecy of the keys, as long as the private key is
kept secret.
Question 05.

5. List down the encryption and decryption steps of the RSA cryptosystem.

The RSA cryptosystem is a widely used public-key cryptography algorithm that is


based on the mathematical difficulty of factoring large composite numbers. The basic
steps for encryption and decryption in the RSA cryptosystem are as follows:

Encryption:

1. Choose two large prime numbers, p and q, and compute their product n = pq.
2. Choose an integer e such that 1 < e < (p-1)(q-1) and e is relatively prime to
(p-1)(q-1).
3. Compute the modular inverse of e modulo (p-1)(q-1), denoted as d, such that
ed ≡ 1 (mod (p-1)(q-1)).
4. Publish the pair (n,e) as the public key, and keep the pair (p,q,d) as the
private key.
5. To encrypt a message M, compute the ciphertext C = Me (mod n).

Decryption:

To decrypt the ciphertext C, compute the plaintext message M = Cd (mod n).

Question 06.

6. List down the asymmetric key generation steps of the RSA cryptosystem.

The basic steps for generating the public and private keys in the RSA cryptosystem
are as follows:

1. Choose two large prime numbers, p and q. It is important to choose large


numbers to ensure the security of the cryptosystem, as the security of the
system relies on the difficulty of factoring the large composite number n = pq.
2. Compute the product n = pq. This is the modulus that will be used in the
encryption and decryption process.
3. Choose an integer e such that 1 < e < (p-1)(q-1) and e is relatively prime to
(p-1)(q-1). This integer e is the public key exponent, and it is used in the
encryption process.
4. Compute the modular inverse of e modulo (p-1)(q-1), denoted as d, such that
ed ≡ 1 (mod (p-1)(q-1)). This integer d is the private key exponent, and it is
used in the decryption process.
5. Publish the pair (n,e) as the public key, and keep the pair (p,q,d) as the
private key.

7. Demonstrate the asymmetric key generation steps, the encryption and the
decryption steps of the RSA algorithm by providing a suitable example.
Here is an example of the key generation, encryption, and decryption steps of the
RSA algorithm using a small example for demonstration purposes:

Key generation:
1. Choose two prime numbers, p = 3 and q = 11.
2. Compute the product n = pq = 3 x 11 = 33.
3. Choose an integer e such that 1 < e < (p-1)(q-1) and e is relatively prime to
(p-1)(q-1). For this example, let's choose e = 7.
4. Compute the modular inverse of e modulo (p-1)(q-1), denoted as d, such that
ed ≡ 1 (mod (p-1)(q-1)). In this case, d = 3 satisfies this condition, because 7 x
3 ≡ 1 (mod 20).
5. The public key is (n,e) = (33,7) and the private key is (p,q,d) = (3,11,3).
Encryption:
6. To encrypt the message M = "HELLO", we can convert the message to a
number m using a suitable encoding scheme (e.g., ASCII). For this example,
let's say that m = 72 (the ASCII code for H).
7. Compute the ciphertext C = Me (mod n) = 727 (mod 33) = 25.

Decryption:
8. To decrypt the ciphertext C, we compute the plaintext message M = Cd (mod
n) = 253 (mod 33) = 72.
This example demonstrates the basic steps of the RSA algorithm, but in practice, the
prime numbers p and q and the exponents e and d would be much larger (typically
several hundred or thousand bits) to ensure the security of the system.

You might also like