Professional Documents
Culture Documents
Cyber Security
Cyber Security
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.
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
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.
Question 03.
Question 04.
5. List down the encryption and decryption steps of the RSA cryptosystem.
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:
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:
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.