GATE / CS ARCHIVE

SUBJECT COLLECTION

Computer Networks · Network Security

11 questions, newest first

GATE CSE has asked 11 questions on Network Security (Computer Networks) from 2009 to 2019, in 10 of the 46 papers; the most recent is in GATE CSE 2019. In the last five years it carried 0 marks per 100-mark paper on average, against 0.5 since 2003. Since 2014 the questions have been 6 MCQ and 2 NAT. 1 group of questions here are solved the same way; “One per method” keeps the newest of each.

Not in the GATE 2027 syllabus. Network security (cryptography, digital signatures, firewalls) is not named.

Browse topics
2 marks · NAT
Not in GATE 2027 syllabusReport issue

Factoring an RSA modulus from its totient

Network Security

Question 54, GATE 2019: For a two-prime RSA modulus n=3007, Euler's totient φ(n)=2880. Find the prime factor of n that exceeds 50.
Tap to enlarge
Answer & solution

Official answer: 97

1. In the standard RSA construction n=pq for distinct primes p,q, and φ(n)=(p−1)(q−1). Expanding gives φ(n)=pq−p−q+1=n−(p+q)+1.
2. Rearrange to recover the prime sum: p+q=n+1−φ(n)=3007+1−2880=128. Their product is already known: pq=3007.
3. Numbers with this sum and product are roots of t²−128t+3007=0. Its discriminant is 128²−4×3007=16384−12028=4356=66².
4. The roots are (128+66)/2=97 and (128−66)/2=31. Both are prime, and their product 97×31=3007 verifies the factorization.
5. Also (97−1)(31−1)=96×30=2880, verifying the given totient. Only 97 is greater than 50, so the required answer is 97.
6. The useful method is recovering p+q from the totient; trial-dividing n is unnecessary. The formula used here relies on the stated RSA two-distinct-prime setting.

Original paper, page 16 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Network Security

Question 15, GATE 2017: S digitally signs message m with its private key and sends it to R. Who can use a birthday attack to replace m with a fraudulent message? I S; II a third-party attacker; III R. A I and II; B I only; C II only; D II and III.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. A birthday collision attack searches for any two distinct messages with the same digest; it does not efficiently target one already fixed digest. For an n-bit digest its generic collision cost is about 2n/2, versus 2n for a fixed-target second preimage.

2. The signer can prepare many harmless and fraudulent variants before selecting what to sign, find a colliding pair, and reuse the signature on the fraudulent member. This makes I possible in the intended hash-then-sign setting.

3. The receiver or outside attacker only receives the fixed signed m. Replacing that requires a second preimage, not the freely chosen birthday pair. Thus II and III do not follow, and B is intended.

Original paper, page 9 · Answer key

2 marks · NAT
Not in GATE 2027 syllabusReport issue

Network Security

Question 44, GATE 2017: RSA uses primes p=13,q=17 and public exponent 35. Find the private exponent (least positive modular inverse).
Tap to enlarge
Answer & solution

Official answer: 11.0

Our answer: 11

1. RSA modulus N=pq=13×17=221. Since p and q are distinct primes, φ(N)=(p−1)(q−1)=12×16=192.

2. The private exponent d must satisfy ed≡1 mod φ(N), so solve 35d≡1 mod192. Euclid gives 192=5×35+17 and 35=2×17+1.

3. Back substitute: 1=35−2(192−5×35)=11×35−2×192. Hence d=11 is the least positive inverse. Check 35×11=385=2×192+1.

Original paper, page 20 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Network Security

Question 52, GATE 2016: B digitally signs message m for A. Kx− denotes x's private key, Kx+ its public key; Kx(m) denotes the paper's encryption notation and H(m) its message digest. Which pair should B send? A:{m,KB+(H(m))}. B:{m,KB−(H(m))}. C:{m,KA−(H(m))}. D:{m,KA+(m)}.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

The signer is B, so the signature is produced with B’s private key on the message digest. A verifies it with B’s public key. The transmitted pair is {m, KB−(H(m))}, B. This is the exam’s simplified signature notation; practical signatures use a secure signature construction and encoding rather than arbitrary raw encryption.

A digital signature authenticates the sender and detects message modification; it does not by itself hide the message. The public key is for verification, not for creating a signature attributable only to B. Using A's key would authenticate the wrong party or provide encryption rather than a B signature. A verifies the received digest signature using B's public key and compares it to the digest independently computed from m. Practical schemes supply the necessary secure padding and signature encoding.

Original paper, page 20 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Network Security

Question 23, GATE 2016: Anarkali digitally signs a message and sends it to Salim. What key does Salim need to verify? A Anarkali’s public; B Salim’s public; C Salim’s private; D Anarkali’s private.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

A digital signature is verified using the signer’s public key. Since Anarkali signed, Salim uses Anarkali’s public key, A.

Signing and encryption serve different purposes. Anarkali signs with her private key; anyone holding an authentic copy of her public key can verify origin and integrity. Salim’s private key would be relevant to decrypting content encrypted for him, not verifying someone else’s signature. Verification also presupposes that the public key really belongs to Anarkali.

Original paper, page 31 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Network Security

Question 24, GATE 2015: N people want pairwise secret communication using symmetric encryption, confidential even from other group members. How many keys are needed in the whole system? A 2N; B N(N−1); C N(N−1)/2; D (N−1)^2.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

A symmetric key can serve both directions of one pair's communication. Count unordered pairs: choose the first member in N ways and the second in N−1 ways, then divide by two because each pair was counted twice. One group-wide key would violate secrecy from other members, while N(N−1) unnecessarily counts two directional keys per pair.

Solution: Every unordered pair needs its own secret key so that third members cannot decode its traffic. There are C(N, 2)=N(N−1)/2 pairs, C.

Original paper, page 10 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Network Security

Question 24, GATE 2014: Which listed algorithms generate message digests in network-security protocols? P: RSA. Q: SHA-1. R: DES. S: MD5. A: P,R only. B: Q,R only. C: Q,S only. D: R,S only.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Method and setup. Classify algorithms by function rather than by the broad label “security.” A message digest is produced by a hash function. Encryption and public-key operations may be used alongside hashes in protocols, but that does not make the encryption algorithm itself the digest algorithm.

2. Work through the result and its assumptions. SHA-1 and MD5 are message-digest hash functions. RSA is a public-key scheme and DES a block cipher. Thus Q and S, C. This historical identification is not a recommendation to use these now-broken collision-resistant hashes.

Original paper, page 13 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Network Security

Question 27, GATE 2014: Q downloads a file over HTTP from H via routers Q→R1→R2→R3→H. Session-layer encryption uses DES with a shared key. Information items: I1 file URL; I2 TCP port numbers at Q and H; I3 IP addresses of Q and H; I4 link-layer addresses of Q and H. By sniffing only at R2, which can an intruder learn? A only I1,I2; B only I1; C only I2,I3; D only I3,I4.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Set up the reasoning. Track which protocol headers remain visible after encrypting the session payload. The HTTP URL is in the protected content, while TCP and IP routing information must remain available to carry the packet.

2. Derive the result. Session-layer encryption hides the HTTP URL payload, while TCP and IP headers still reveal endpoint ports and IP addresses. Link-layer headers at R2 identify its neighboring hops, not the remote hosts Q and H. Thus I2 and I3 only, C, under the stated encrypted-payload model without cryptanalysis.

3. Check the interpretation. Link-layer addresses change from hop to hop. A frame observed at an intermediate router need not contain either end host's hardware address. The answer assumes the stated encryption model, not successful DES cryptanalysis or other side channels.

Original paper, page 35 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Confidential authenticated public-key message

Network Security

Question 13, GATE 2013: X signs message M, encrypts the message/signature pair for Y, and Y decrypts and verifies. Choose the ordered key sequence. A sender private, recipient private;sender public, recipient public. B sender private, recipient public;sender public, recipient private. C sender public, recipient private;recipient public, sender private. D sender private, recipient public;recipient private, sender public.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

X authenticates by signing with X’s private key and protects confidentiality for Y using Y’s public key. Y decrypts with Y’s private key and verifies the signature with X’s public key. This matches D. Actual signature schemes need not literally encrypt the whole message with the signing key; signing/verification is the appropriate cryptographic interpretation.

Authentication and confidentiality have different key owners. Only X should be able to create X’s signature, so signing uses X’s private key. Anyone may encrypt a message for Y using Y’s public key, but only Y’s private key decrypts it. Since encryption is the outer layer, Y must first remove that layer and only then verify X’s signature with X’s public key. D has that receive-side order; B reverses the two receive operations. Real signatures use a signature algorithm, usually over a digest, rather than literal message encryption.

Original paper, page 3 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Layer-four firewall limitation

Network Security

Question 2, GATE 2011: A layer-4 firewall can inspect all protocol headers up to the transport layer. Which action can it NOT perform?

(A) Block all HTTP traffic between 9:00 PM and 5:00 AM
(B) Block all ICMP traffic
(C) Block incoming traffic from a specific IP address but allow outgoing traffic to that address
(D) Block TCP traffic from a specific user on a multi-user system between 9:00 PM and 5:00 AM
Tap to enlarge
Your answer
Answer & solution

Official answer: D

IP addresses, protocol numbers and transport ports are present in network/transport headers, allowing conventional address, protocol and port-based time rules. A particular logged-in user on a shared machine is not identified by these headers, so a layer-four firewall alone cannot implement D. The HTTP option assumes the conventional known service ports, rather than universal application identification on arbitrary ports.

Separate the information needed for each rule from the information available in a packet. A time rule can consult the firewall's clock; an IP rule can inspect the source/destination address; ICMP is identified by the network protocol field. A TCP segment identifies ports and endpoints, not which operating-system user owns its connection. Enforcing that last distinction needs additional identity information, such as a host agent or authenticated application proxy.

Original paper, page 2 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

RSA exponent and modulus conditions

Network Security

Question 46, GATE 2009: RSA has n=pq and φ(n)=(p−1)(q−1), message 0<M<n. The source calls(e, n) private and(d, n) public. Assess I M′=M^e mod n and M=(M′)^d mod n; II ed≡1 mod n; III ed≡1 mod φ(n); IV both message exponentiations use modulusφ(n). A I/II; B I/III; C II/IV; D III/IV.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

RSA exponentiation is modulo n=pq, and the chosen exponents obey ed≡1 (mod φ(n)), with φ(n)=(p−1)(q−1). Thus statements I and III are correct, option B. Writing ed=1+kφ(n), Euler’s theorem proves Med≡M modulo n when M is coprime to n; reduction separately modulo p and q, followed by the Chinese remainder theorem, also proves it for non-coprime messages. Statement II incorrectly uses modulus n for the exponent-inverse condition; IV incorrectly performs message arithmetic modulo φ(n). The question reverses the usual names of e and d (calling e private and d public), but RSA’s mathematical inversion works either way and the answer is unchanged.

Two different moduli serve different roles. Messages live modulo n, while the inverse relationship between exponents is taken moduloφ(n) (or a suitable Carmichael modulus in other formulations). Combining the message exponentiations gives Med; choosing ed=1+kφ(n) returns M. This explains I and III and rejects the distractors that interchange these moduli. The source’s naming of e and d is reversed from many textbooks but does not alter the algebra.

Original paper, page 10