0% found this document useful (0 votes)
5 views15 pages

CN Module6

The document contains a series of questions and answers related to cryptography, including symmetric and asymmetric key systems, the use of firewalls, VPNs, and the RSA algorithm. It discusses the number of keys required for secure communication, the role of certification authorities, and methods for preventing password guessing attacks. Additionally, it provides detailed explanations for specific RSA calculations and the importance of key sizes in maintaining security.

Uploaded by

sandipanmaji007
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)
5 views15 pages

CN Module6

The document contains a series of questions and answers related to cryptography, including symmetric and asymmetric key systems, the use of firewalls, VPNs, and the RSA algorithm. It discusses the number of keys required for secure communication, the role of certification authorities, and methods for preventing password guessing attacks. Additionally, it provides detailed explanations for specific RSA calculations and the importance of key sizes in maintaining security.

Uploaded by

sandipanmaji007
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

✅ 2 Marks Questions

1. In symmetric-key cryptography, how many keys are needed if Alice and Bob
want to communicate with each other?

In symmetric-key cryptography, only one secret key is needed for communication between
Alice and Bob, and this key is shared by both parties.

2. In symmetric-key cryptography, can Alice use the same key to communicate


with both Bob and John? Explain your answer.

In symmetric-key cryptography, Alice should not use the same key to communicate with both
Bob and John because each pair of users must have a unique secret key to ensure security and
prevent unauthorized access.

3. In symmetric-key cryptography, if every person in a group of 10 people needs


to communicate with every other person in another group of 10 people, how
many secret keys are needed?

In symmetric-key cryptography, if each of the 10 people communicates with 10 people in


another group, the total number of secret keys required is 10 × 10 = 100 keys.

4. In symmetric-key cryptography, if every person in a group of 10 people needs


to communicate with every other person in the group, how many secret keys are
needed?

In this case, the number of keys required is given by the formula n(n−1)/2, so for 10 people, the
number of keys needed is 10 × 9 / 2 = 45 keys.

5. In asymmetric-key cryptography, how many keys are needed if Alice and Bob
want to communicate with each other?
In asymmetric-key cryptography, each user has a pair of keys (public and private), so Alice and
Bob together need two key pairs (four keys in total).

6. In asymmetric-key cryptography, can Alice use the same key to communicate


with both Bob and John? Explain your answer.

Yes, in asymmetric-key cryptography, Alice can use the same public key to receive messages
from both Bob and John, as the public key is shared openly while the private key remains secret.

7. In asymmetric-key cryptography, if every person in a group of 10 people needs


to communicate with every other person in another group of 10 people, how
many secret keys are needed?

In asymmetric-key cryptography, each person has one key pair, so for 20 people (two groups),
the total number of keys required is 20 key pairs (40 keys).

8. In asymmetric-key cryptography, if every person in a group of 10 people needs


to communicate with every other person in the group, how many secret keys are
needed?

In this case, each of the 10 people requires one key pair, so the total number of keys is 10 key
pairs (20 keys).

15. What is a certification authority?

A certification authority is a trusted organization that issues, verifies, and manages digital
certificates.

16. What are some advantages and disadvantages of using long passwords?

The advantage of long passwords is that they provide strong security and are difficult to guess,
while the disadvantage is that they are hard to remember and manage.
17. We discussed fixed and one-time passwords as two extremes. What about
frequently changed passwords? How do you think this scheme can be
implemented? What are the advantages and disadvantages?

Frequently changed passwords can be implemented by enforcing periodic password updates. The
advantage is improved security over time, while the disadvantage is that users may choose
weaker passwords or reuse patterns.

18. How can a system prevent a guessing attack on a password? How can a bank
prevent PIN guessing if someone has found or stolen a bank card and tried to use
it?

A system can prevent guessing attacks by using techniques such as account lockout after
several failed attempts, CAPTCHA, and delays between attempts, while banks prevent PIN
guessing by limiting the number of incorrect PIN entries and blocking the card after
repeated failures.

26. What is the difference between a session and a connection in SSL?

In SSL, a session is a set of security parameters (like encryption algorithms and keys) established
between a client and server, while a connection is a specific communication link that uses the
parameters defined by a session, and multiple connections can share the same session.

31. What is the purpose of a firewall?

The purpose of a firewall is to monitor and control incoming and outgoing network traffic
based on predefined security rules in order to protect a network from unauthorized access and
attacks.

32. What are the two types of firewalls?

The two main types of firewalls are packet-filtering firewalls and proxy (application-level)
firewalls.
33. What is a VPN and why is it needed?

A Virtual Private Network (VPN) is a technology that creates a secure and encrypted
connection over a public network, and it is needed to ensure privacy, data security, and safe
remote access.

Here are the required 5-mark answers (11, 13–24) in the same single-paragraph, textbook-
style format with essential examples:

✅ 5 Marks Questions

11. A hash algorithm creates a digest of N bits. How many different digests can
be created from this algorithm?

Answer:
A hash algorithm that generates a digest of N bits can produce a total of 2ⁿ different digests,
because each bit in the digest can take one of two possible values (0 or 1), and therefore the total
number of combinations is 2 raised to the power N; for example, if the digest size is 3 bits, the
possible outputs are 000, 001, 010, 011, 100, 101, 110, and 111, giving a total of 8 (2³) unique
digests, and as N increases (e.g., 256 bits in SHA-256), the number of possible digests becomes
extremely large, reducing collision probability and enhancing security.

13. Which one is more feasible, a fixed-size digest or a variable-size digest?


Explain your answer.

Answer:
A fixed-size digest is more feasible because it provides uniformity, efficiency, and better
security, as all outputs have the same length regardless of input size, making storage,
comparison, and transmission easier; for example, SHA-256 always produces a 256-bit digest
whether the input is a short word or a long file, whereas variable-size digests can create
inconsistency and may weaken security by revealing information about input size.

14. Are the processes of creating a MAC and of signing a hash the same? What
are the differences?
Answer:
The processes of creating a Message Authentication Code (MAC) and signing a hash are not the
same because a MAC uses a shared symmetric key while a digital signature uses asymmetric
cryptography with a private key; for example, in MAC both sender and receiver use the same
secret key to generate and verify the code, whereas in digital signatures the sender signs the hash
using their private key and the receiver verifies it using the sender’s public key, providing
authentication as well as non-repudiation.

15. When a person uses a money machine to get cash, is this a message
authentication, an entity authentication, or both?

Answer:
When a person uses a money machine (ATM) to withdraw cash, it involves both entity
authentication and message authentication, because the system verifies the identity of the user
through a PIN (entity authentication) and also ensures that the transaction details exchanged
between the ATM and bank server are valid and unaltered (message authentication); for
example, entering the correct PIN proves the user’s identity, while secure communication
ensures the transaction amount is not modified.

16. In a university, a student needs to encrypt her password (with a unique


symmetric key) before sending it when she logs in. Does encryption protect the
university or the student? Explain your answer.

Answer:
Encryption of the password primarily protects the student, because it ensures that the password
is not exposed to attackers during transmission over the network, preventing unauthorized access
to the student’s account; for example, if the password is sent in plaintext, an attacker could
intercept it, but encryption ensures that even if intercepted, the attacker cannot understand it,
thereby maintaining confidentiality.

17. In symmetric-key cryptography, how do you think two persons can establish
a secret key between themselves?

Answer:
In symmetric-key cryptography, two persons can establish a secret key by using a secure key
exchange method, such as physically sharing the key or using a protocol like Diffie-Hellman to
generate a shared key over an insecure channel; for example, in the Diffie-Hellman method, both
parties exchange public values and compute the same secret key independently without directly
transmitting it, ensuring secure key establishment.
18. Encrypt the message "THIS IS AN EXERCISE" using a shift cipher with a
key of 20. Ignore the space between words. Decrypt the message to get the
original plaintext.

Answer:
In a shift cipher with a key of 20, each letter in the plaintext is shifted 20 positions forward in the
alphabet (wrapping around if necessary), so the message “THISISANEXERCISE” becomes
NBCMCMUHYRCLWCYMCY after encryption; for example, T shifts to N and H shifts to B,
and when decrypting, each letter is shifted backward by 20 positions to retrieve the original
plaintext, demonstrating that encryption and decryption are inverse processes.

19. Can we use monoalphabetic substitution if our symbols are just 0 and 1? Is it
a good idea?

Answer:
Yes, monoalphabetic substitution can technically be used with symbols 0 and 1, but it is not a
good idea because the number of possible substitutions is extremely limited, making the system
very weak and easy to break; for example, swapping 0 with 1 or keeping them the same are the
only possibilities, which provides almost no security against attacks.

20. Can we use polyalphabetic substitution if our symbols are just 0 and 1? Is it a
good idea?

Answer:
Polyalphabetic substitution can also be applied to binary symbols (0 and 1), but it is not effective
because the limited symbol set significantly reduces complexity and security; for example, even
if multiple substitution rules are used, the patterns can still be easily detected due to only two
possible symbols, making the cipher vulnerable to analysis.

21. What are all the possible number combinations of inputs in a 6-by-2 S-box?
What is the possible number of outputs?

Answer:
In a 6-by-2 S-box, there are 6 input bits, so the total number of possible input combinations is 2⁶
= 64, and since the output consists of 2 bits, the number of possible outputs is 2² = 4; for
example, inputs range from 000000 to 111111 (64 combinations), and outputs can be 00, 01, 10,
or 11.
22. A P-box uses the following table for encryption. Show the box and connect
the input to the output. Is the P-box straight, compression, or expansion?

Answer:
A P-box (permutation box) rearranges the positions of input bits according to a predefined
mapping table, and if the number of input bits is equal to the number of output bits, it is called a
straight P-box, whereas if the output is fewer or greater, it is compression or expansion
respectively; for example, if 4 input bits are simply rearranged into 4 output bits without
changing their number, it is a straight P-box.

23. In RSA, given two prime numbers p = 19 and q = 23, find n and φ(n). Choose
e = 5 and try to find d, such that e and d meet the criteria.

Answer:
In RSA, the value of n is calculated as n = p × q = 19 × 23 = 437, and φ(n) = (p−1)(q−1) = 18 ×
22 = 396; choosing e = 5 such that it is relatively prime to 396, we find d such that (d × 5) mod
396 = 1, which gives d = 317, and for example, this pair (e = 5, d = 317) satisfies the RSA
condition for encryption and decryption.

24. To understand the security of the RSA algorithm, find d if you know that e =
17 and n = 187. This exercise proves how easy it is for Eve to break the secret if n
is small.

Answer:
Given n = 187, we first factor it as 187 = 11 × 17, so φ(n) = (11−1)(17−1) = 10 × 16 = 160, and
with e = 17, we find d such that (d × 17) mod 160 = 1, which gives d = 113; for example, since n
is small, it is easy to factor and compute d, demonstrating that RSA becomes insecure when
small values of n are used.

Good — these two are important for understanding RSA properly, so I’ll explain them step by
step in a clear and simple way.

✅ Question 23 (Detailed Explanation)


Given:

p = 19, q = 23, e = 5

Step 1: Find n

In RSA,
[
n = p \times q
]
[
n = 19 \times 23 = 437
]

Step 2: Find φ(n)

[
\phi(n) = (p-1)(q-1)
]
[
\phi(n) = 18 \times 22 = 396
]

Step 3: Check e

e must satisfy:

 (1 < e < \phi(n))


 gcd(e, φ(n)) = 1

Here,
gcd(5, 396) = 1 ✔️ → valid

Step 4: Find d

We need:
[
(d \times e) \mod \phi(n) = 1
]
[
d \times 5 \equiv 1 \ (\text{mod } 396)
]

Now solve:
We look for a number d such that 5d = 1 + 396k

Try k = 4:
[
5d = 1 + 396 \times 4 = 1585
]
[
d = 1585 / 5 = 317
]

✔️ So,
d = 317

Final Answer:

 n = 437
 φ(n) = 396
 e=5
 d = 317

Concept Understanding:

 Public key = (e, n) → (5, 437)


 Private key = (d, n) → (317, 437)
 e is used for encryption
 d is used for decryption

✅ Question 24 (Detailed Explanation)


Given:
n = 187, e = 17

Step 1: Factor n

To find φ(n), we must factor n:

[
187 = 11 \times 17
]

So,
p = 11, q = 17

Step 2: Find φ(n)

[
\phi(n) = (p-1)(q-1)
]
[
\phi(n) = 10 \times 16 = 160
]

Step 3: Find d

We need:
[
d \times 17 \equiv 1 \ (\text{mod } 160)
]

So,
[
17d = 1 + 160k
]

Try k = 12:
[
17d = 1 + 1920 = 1921
]
[
d = 1921 / 17 = 113
]

✔️ So,
d = 113

Final Answer:

 p = 11, q = 17
 φ(n) = 160
 e = 17
 d = 113

Important Insight (Very Important for Exams ⚠️):

This question shows a weakness of RSA:

 Since n = 187 is small, it is very easy to factor it into 11 and 17


 Once we know p and q, we can easily compute φ(n) and then d
 This means an attacker (Eve) can break the encryption easily

👉 That is why in real systems, n is extremely large (like 2048 bits)

✅ Simple Summary (for memory):

 RSA security depends on difficulty of factoring n


 Small n → easy to break
 Large n → secure

Got it — I’ll rewrite all 10-mark answers in proper Question–Answer format, with the full
question written and the step-by-step structured answer exactly in the style you liked.

✅ 10 Marks Questions (Full Q–A Format)


1. Encrypt "INTERNET" using a transposition cipher with the following key.

Answer:
In a columnar transposition cipher, the plaintext is written row-wise into a table based on the
number of columns determined by the key, and the ciphertext is obtained by reading the columns
in the order specified by the key.

Step 1: Write the plaintext in tabular form


Plaintext: INTERNET
Key: 3 1 4 2

I N T E
R N E T

Step 2: Determine column order using the key


1 → Column 2, 2 → Column 4, 3 → Column 1, 4 → Column 3

Step 3: Read columns in order


Column 2 → N N
Column 4 → E T
Column 1 → I R
Column 3 → T E

Step 4: Form the ciphertext


Ciphertext = NNETIRTE

Explanation:
This method rearranges the positions of characters without altering them, and the security
depends on the secrecy of the key.

2. A message is 20,000 characters. We are using a digest of this message using


SHA-1. After creating the digest, we decided to change the last 10 characters.
Can we say how many bits in the digest will be changed?

Answer:
SHA-1 produces a fixed digest of 160 bits.

Step 1: Understand avalanche effect


A small change in input causes a large and unpredictable change in output.

Step 2: Apply concept


Even changing a single character can affect many bits in the digest.
Step 3: Conclusion
It is not possible to determine exactly how many bits will change, but typically about half the bits
(around 80 out of 160) may change.

Explanation:
Hash functions are designed to produce completely different outputs even for small input
changes to ensure strong security.

3. A message is made of 10 numbers between 00 and 99. A hash algorithm creates


a digest out of this message by adding all numbers modulo 100. The resulting
digest is a number between 00 and 99. Does this algorithm meet the first, second,
and third criteria of a hash algorithm?

Answer:

Step 1: Understand the algorithm


Digest = sum of all numbers mod 100

Step 2: Evaluate criteria

 Compression → Yes (multiple inputs to single output)


 Ease of computation → Yes (simple addition)
 Collision resistance → No

Step 3: Example
(10 + 20) mod 100 = 30
(5 + 25) mod 100 = 30 → same output

Conclusion:
The algorithm fails the third criterion (collision resistance).

4. The leftmost bit of a 4-by-3 S-box rotates the other 3 bits. If the leftmost bit is
0, the 3 other bits are rotated to the right by 1 bit. If the leftmost bit is 1, the 3
other bits are rotated to the left by 1 bit. If the input is 1011, what is the output?
If the input is 0110, what is the output?

Answer:

Case 1: Input = 1011


Leftmost bit = 1 → rotate left
Remaining bits = 011 → 110
Output = 1110

Case 2: Input = 0110


Leftmost bit = 0 → rotate right
Remaining bits = 110 → 011
Output = 0011

Explanation:
The first bit determines rotation direction while the remaining bits are shifted accordingly.

5. A 6-by-2 S-box adds the bits at odd-numbered positions to get the right output
bit and adds the bits at even-numbered positions to get the left output bit. If the
input is 110010 and 101101, what are the outputs?

Answer:

Case 1: Input = 110010


Odd positions → 1+0+1 = 2 → 0
Even positions → 1+0+0 = 1 → 1
Output = 01

Case 2: Input = 101101


Odd positions → 1+1+0 = 2 → 0
Even positions → 0+1+1 = 2 → 0
Output = 10

Explanation:
Bits are grouped and summed to produce output bits.

10. In asymmetric-key cryptography, how do you think two persons can establish
two pairs of keys between themselves?

Answer:

Step 1: Key generation


Each person generates their own public-private key pair

Step 2: Exchange
Public keys are shared
Step 3: Usage
Encryption uses receiver’s public key, decryption uses private key

Explanation:
This method ensures secure communication without sharing private keys.

You might also like