This set of Computer Networks Multiple Choice Questions & Answers (MCQs) focuses on “Hash Functions”.

1. Which of the following equation is correct in case of hash function, where M = input, N = hash value, H = hash function?

a) H = M(N)

b) M = H(N)

c) N = H(M)

d) N = M(H)

View Answer

Explanation: M is a block of data that is accepted by the hash function. Hash function(H) accepts the input and hash function will be performed. N is the fixed length of hash value of the block of input.

2. What is/are the property(s) of a good hash function in case of producing outputs for set of inputs?

a) Apparently random hash values

b) Evenly distributed hash values

c) Apparently random and evenly distributed values

d) Evenly distributed but not apparently random values

View Answer

Explanation: When a huge set of input blocks are given to a hash function, a good hash function will result in unique random values with no relation between them. At the same all the hash values will be equal that is fixed length.

3. What is the core objective of the hash functions in producing hash values?

a) Integrity

b) Authenticity

c) Confidentiality

d) Security

View Answer

Explanation: Integrity means retrieving the lost data as soon as possible. Hash functions accomplish integrity, because, even one bit is changed in the data, it will result in a change of hash value with high probability.

4. What is the name for hash functions that are used in security applications?

a) Secured hash function

b) Cryptographic hash function

c) Security hash function

d) Crypt-analysis hash function

View Answer

Explanation: The cryptographic hash function is an algorithm, which is used in security applications. It is computationally infeasible to attack the algorithm. Because it doesn’t allow the attacker to crack either of its properties, that are collision free property and one-way property.

5. Which of the following application in which hash function is employed, refers hash value as message digest?

a) Message authentication

b) Virus detection

c) Digital signatures

d) One-way password file

View Answer

Explanation: The application “message authentication” is used to obtain the integrity of the message. Sender sends hash value of the message along with message, then receiver performs the same hash function on the message. If both the message digests are same, means, integrity is achieved.

6. What is the other name for key hash function, which is used in message authentication?

a) Message administration control

b) Message authentication code

c) Message administration code

d) Message authentication control

View Answer

Explanation: Message authentication code that is key hash function is mostly used in message authentication. This MAC function results a MAC value, by taking the input block of data and secret key. This MAC value is used to check whether data has changed or not.

7. What is C_{i} in the bit-by-bit XOR hash function, that is C_{i} = b_{i1} + b_{i2}.….. + b_{im}

a) Number of n bit blocks

b) i^{th} bit of the hash code

c) i^{th} bit in j^{th} block

d) XOR operation

View Answer

Explanation: “m” is the number of n-bit blocks in the input, b

_{ij}is the i

^{th}bit in the j

^{th}block, c

_{i}is the i

^{th}bit of the hash code. Operation between the bits is exclusive OR and this operation is performed on every input block.

8. When can we detect a collision if the hash values are same for two inputs, that is H(x) = H(y)?

a) When x < y

b) When x > y

c) When x = y

d) When x != y

View Answer

Explanation: Hash function’s primary objective is to provide integrity. No two inputs should have the same hash value, which causes the collision. Collisions are undesirable in hash functions.

9. What is the formula for pre-images of a given hash value, where data block length = b bits and hash code = n bits?

a) 2^{b-n}

b) 2^{b+n}

c) 2^{b/n}

d) 2^{n/b}

View Answer

Explanation: In the hash value h = H(x), x is the preimage of the hash value. 2

^{b-n}formula finds the total number of possible collisions for a hash value. Here b > n and 2

^{b}is the total number of possible messages, 2

^{n}is the total number of possible hash values.

10. Which of the following is not a basic property for employing hash function in practical applications?

a) Variable input size

b) Fixed output size

c) Efficiency

d) Preimage resistant

View Answer

Explanation: Hash function will produce fixed lengths of outputs and accepts any size of blocks as input. It is efficient to calculate. If these three requirements need to be met to implement hash function in practical applications.

11. Which of the following property of the hash function makes the hash function strong?

a) Efficiency

b) Preimage resistant

c) Second preimage resistant

d) Collision resistant

View Answer

Explanation: Hash function is referred as weak, when it only satisfies the Efficiency, preimage resistant, second image resistant, fixed length output, variable length input. It is referred as strong if it satisfies the collision resistant along with all of the above.

12. Brute force attack does not concentrate on bit length of the hash value.

a) True

b) False

View Answer

Explanation: The attacks that are on hash functions are brute force attack and crypt-analysis. Brute force attack mainly concentrates on the bit length of the hash function, whereas crypt-analysis concentrates on cryptographic algorithms.

**Sanfoundry Global Education & Learning Series – Computer Networks.**

To practice all areas of Computer Networks, __here is complete set of 1000+ Multiple Choice Questions and Answers__.

**If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]**

**Related Posts:**

- Apply for Computer Science Internship
- Check Computer Network Books
- Check Computer Science Books
- Practice MCA MCQs
- Practice Computer Science MCQs