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

Class Test one 06.11.24

Ccs class test Question paper Answervkey

Uploaded by

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

Class Test one 06.11.24

Ccs class test Question paper Answervkey

Uploaded by

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

CB3491- CRYPTOGRAPHY AND CYBER

SECURITY
ANSWER KEY – CLASS TEST ON 06.11.2024
PART A (2 Marks)

1.State Fermat‟s theorem and list its uses


Fermat's Theorem
This is sometimes referred to as Fermat's
little theorem.
First version
Fermat's theorem states the following: If
p is prime and a is a positive integer not
divisible by p, then

Second Version
An alternative form of Fermat's theorem
is also useful: If p is prime and a is a
positive integer, then
2.Find the GCD of (2740, 1760) using
Euclid‟s Algorithm.
GCD(2749,1760)=20
3.State Euler‟s theorem.
In number theory, Euler's theorem (also known as the Fermat–Euler
theorem or Euler's totient theorem) states that,
if n and a are coprime positive integers, then is congruent
to modulo n, where denotes Euler's totient function; that is

4.Using Fermat‟s theorem find 5201


and mod 41
Using Fermat's Little Theorem (FLT) to find 52^01 mod 41:

_Fermat's Little Theorem:_

a^(p-1) ≡ 1 (mod p)

_Given:_

a = 52
p = 41

_Apply FLT:_
52^(41-1) ≡ 1 (mod 41)
52^40 ≡ 1 (mod 41)

_Reduce exponent using FLT:_

52^01 ≡ 52^(40*1+1) ≡ (52^40)^1 * 52^1 ≡


1^1 * 52^1 ≡ 52^1 (mod 41)

_Compute 52^1 mod 41:_

52^1 ≡ 52 (mod 41)

_Result:_

52^01 ≡ 52 (mod 41)

Therefore, 52^01 mod 41 = 52.

PART- B
1.Explain RSA algorithm, perform
encryption and decryption to the
system with p=7, q=11, e=17, M=8(8)

2.Users Alice and Bob use the Diffie-


Hellman key exchange technique with a
common prime q=83 and a primitive root
α=5.

i. If Alice has a private key XA=6, what


is Alice‟s public key YA? (2 marks )

ii. If Bob has a private key XB=10, what


is Bob‟s public key YB?(2 marks)

iii. What is the shared secret key? (3


marks)

3.State Chinese Remainder Theorem and


find X for the given set of congruent
equations using CRT
X=1 (mod 5)
X=2 (mod 7)
X=3 (mod 9)
X=4 (mod 11) (7 Marks )
Here's an explanation of the RSA
algorithm, along with encryption and
decryption examples using the given
parameters:

*RSA Algorithm Overview*

RSA (Rivest-Shamir-Adleman) is a public-


key encryption algorithm based on the
principle of asymmetric cryptography.

*Key Generation*

1. Choose two large prime numbers: p =


7, q = 11
2. Compute modulus (n): n = p * q = 7 *
11 = 77
3. Compute Euler's totient function (φ(n)):
φ(n) = (p-1) * (q-1) = 6 * 10 = 60
4. Choose public exponent (e): e = 17
(coprime to φ(n))
5. Compute private exponent (d): d = e^(-
1) mod φ(n) = 17^(-1) mod 60 = 53

*Public and Private Keys*

Public Key: (e, n) = (17, 77)


Private Key: (d, n) = (53, 77)

*Encryption*
Message (M): 8

Encryption formula: C = M^e mod n


C = 8^17 mod 77
C = 64

*Decryption*

Decryption formula: M = C^d mod n


M = 64^53 mod 77
M=8

*Example Walkthrough*

Alice wants to send the message "8" to


Bob.

1. Alice encrypts the message using Bob's


public key (17, 77): C = 8^17 mod 77 = 64
2. Alice sends the ciphertext (64) to Bob.
3. Bob decrypts the ciphertext using his
private key (53, 77): M = 64^53 mod 77 =
8

*Security*

RSA security relies on:


1. Difficulty of factoring large numbers (p,
q)
2. Difficulty of computing discrete
logarithms

*Advantages and Limitations*

Advantages:

- Secure data transmission


- Digital signatures

Limitations:

- Computational overhead
- Key size limitations 2. Here are
the solutions:

i. Alice's Public Key (YA)

Given:

- Private key (XA) = 6


- Primitive root (α) = 5
- Common prime (q) = 83

Alice's Public Key (YA) = α^XA mod q


= 5^6 mod 83
= 5^6 = 15625 mod 83
=8

So, Alice's public key (YA) = 8.

ii. Bob's Public Key (YB)

Given:

- Private key (XB) = 10


- Primitive root (α) = 5
- Common prime (q) = 83

Bob's Public Key (YB) = α^XB mod q


= 5^10 mod 83
= 5^10 = 9765625 mod 83
= 73

So, Bob's public key (YB) = 73.

iii. Shared Secret Key (K)

Alice computes:

K = YB^XA mod q
= 73^6 mod 83
= 73^6 = 31640625 mod 83
= 58
Bob computes:

K = YA^XB mod q
= 8^10 mod 83
= 8^10 = 1073741824 mod 83
= 58

So, the shared secret key (K) = 58.

3.x = (M1 X1 a1 + M2 X2 a2 + M3 X3 a3 +
M4 X4 a4) mod M
= (693 * 2 * 1 + 495 * 3 * 2 + 385 * 4 * 3 +
315 * 8 * 4) mod 3465
= (1386 + 2970 + 4620 + 10,080) mod
3465
= 19056 mod 3465
= 1731
x = 1731

To Verify the answer: - x mod mi = ai


1731 mod 5 = 1
1731 mod 7 = 2
1731 mod 9 = 3
1731 mod 11 = 4

You might also like