Network Security · Computer Networks
17 questions · asked in 12 of 27 years (2000–2026)
MCQ 15 · NAT 21-mark 12 · 2-mark 5
2000Questions per year2026
Questions 11–15 of 17
You are given the following four bytes :
Which of the following are substrings of the base 64 encoding of the above four bytes?
Which of the following are substrings of the base 64 encoding of the above four bytes?
Answer: (B)
Write all 32 bits and cut them into groups of 6 bits. The last group has only 2 bits, so pad it with four 0 bits:
These are the values 40, 51, 31, 41, 42, 48. In the base 64 table (A to Z is 0 to 25, a to z is 26 to 51) they are:
Since the 4 bytes do not fill a whole number of 3-byte groups, the encoding ends with the padding , so the full string is .
Now check the options: zdp is not in it. fpq is (letters 3 to 5). qwA is not, because after qw comes = and not A. oze is not, because o and z are followed by f.
Answer: (B)
These are the values 40, 51, 31, 41, 42, 48. In the base 64 table (A to Z is 0 to 25, a to z is 26 to 51) they are:
Since the 4 bytes do not fill a whole number of 3-byte groups, the encoding ends with the padding , so the full string is .
Now check the options: zdp is not in it. fpq is (letters 3 to 5). qwA is not, because after qw comes = and not A. oze is not, because o and z are followed by f.
Answer: (B)
A firewall is to be configured to allow hosts in a private network to freely open TCP connections and send packets on open connections. However, it will only allow external hosts to send packets on existing open TCP connections or connections that are being opened (by internal hosts) but not allow them to open TCP connections to hosts in the private network. To achieve this the minimum capability of the firewall should be that of
Answer: (D)
(A) A combinational circuit has no memory, but the firewall must remember which connections are open. So it fails.
(B) A finite automaton has only a fixed number of states, but the number of open connections has no upper limit. So it fails.
(C) A pushdown automaton with one stack has unbounded memory, but it can read only the top of the stack. To look at a connection stored lower down, it must pop the ones above, and popping destroys that information, because it has no other unbounded place to keep it. So it cannot check an arbitrary connection when a packet arrives.
(D) With two stacks, the popped items can be pushed on the second stack and put back later, so any stored connection can be reached without losing the rest. A two-stack pushdown automaton is as powerful as a Turing machine, so it can do the job.
Answer: (D)
(B) A finite automaton has only a fixed number of states, but the number of open connections has no upper limit. So it fails.
(C) A pushdown automaton with one stack has unbounded memory, but it can read only the top of the stack. To look at a connection stored lower down, it must pop the ones above, and popping destroys that information, because it has no other unbounded place to keep it. So it cannot check an arbitrary connection when a packet arrives.
(D) With two stacks, the popped items can be pushed on the second stack and put back later, so any stored connection can be reached without losing the rest. A two-stack pushdown automaton is as powerful as a Turing machine, so it can do the job.
Answer: (D)
The minimum positive integer p such that is
Answer: (D)
We need the smallest with .
Since 17 is prime and 17 does not divide 3, Fermat's little theorem gives . So the smallest such divides 16, and it can only be 1, 2, 4, 8 or 16.
Compute by repeated squaring:
None of 1, 2, 4, 8 gives 1. In particular , so option (B) 8 fails. Options (A) 5 and (C) 12 do not divide 16, so they cannot be the smallest power either.
So the smallest is 16.
Answer: (D)
Since 17 is prime and 17 does not divide 3, Fermat's little theorem gives . So the smallest such divides 16, and it can only be 1, 2, 4, 8 or 16.
Compute by repeated squaring:
None of 1, 2, 4, 8 gives 1. In particular , so option (B) 8 fails. Options (A) 5 and (C) 12 do not divide 16, so they cannot be the smallest power either.
So the smallest is 16.
Answer: (D)
Consider the following two statements:
i.A hash function (these are often used for computing digital signatures) is an injective function.
ii. An encryption technique such as DES performs a permutation on the elements of its input alphabet.
Which one of the following options is valid for the above two statements?
i.A hash function (these are often used for computing digital signatures) is an injective function.
ii. An encryption technique such as DES performs a permutation on the elements of its input alphabet.
Which one of the following options is valid for the above two statements?
Answer: (C)
Statement (i) is false. A hash function maps a message of any length to a fixed-length value, so many different messages must give the same hash. It is many-to-one, not injective.
Statement (ii) is true. DES must be reversible, so that decryption can recover the plain text. For a fixed key, it maps each 64-bit input block to a different 64-bit output block, so it is a bijection, that is, a permutation of the set of 64-bit blocks.
So only (ii) is true.
Answer: (C)
Statement (ii) is true. DES must be reversible, so that decryption can recover the plain text. For a fixed key, it maps each 64-bit input block to a different 64-bit output block, so it is a bijection, that is, a permutation of the set of 64-bit blocks.
So only (ii) is true.
Answer: (C)
Which of the following statement(s) is TRUE?
I. A hash function takes a message of arbitrary length and generates a fixed length code.
II. A hash function takes a message of fixed length and generates a code of variable length.
III. A hash function may give the same hash value for distinct messages.
I. A hash function takes a message of arbitrary length and generates a fixed length code.
II. A hash function takes a message of fixed length and generates a code of variable length.
III. A hash function may give the same hash value for distinct messages.
Answer: (C)
Statement I is true: a hash function takes a message of any length and gives a code of fixed length.
Statement II is false: the input is not limited to a fixed length, and the output length is fixed, not variable.
Statement III is true: the possible messages are far more than the possible codes, so two different messages can have the same hash (a collision). For example, gives the same value for 1 and 11. Cryptographic hash functions also have collisions, but they are hard to find.
Answer: (C)
Statement II is false: the input is not limited to a fixed length, and the output length is fixed, not variable.
Statement III is true: the possible messages are far more than the possible codes, so two different messages can have the same hash (a collision). For example, gives the same value for 1 and 11. Cryptographic hash functions also have collisions, but they are hard to find.
Answer: (C)
Keep practising
Topics in Computer Networks
OSI LayerPhysical LayerData Link LayerNetwork Layer ProtocolTransport Layer ProtocolApplication Layer Protocols
Network SecurityYou are here