1,718 views

Which among the following statement(s) is(are) true?

1. A hash function takes a message of arbitrary length and generates a fixed length code
2. A hash function takes a message of fixed length and generates a code of variable length
3. A hash function may give same hash value for distinct messages

Choose the correct answer from the options given below:

1. $(a)$ only
2. $(b)$ and $(c)$ only
3. $(a)$ and $(c)$ only
4. $(b)$ only

1. A hash function takes a message of arbitrary length and generates a fixed length code. This is correct, this is directly from definition of hash function.  Ref: https://en.wikipedia.org/wiki/Hash_function
1. As I is correct II is wrong.
1. This is true. eg: Hash function N%8, this will generate same values for 1 as well as 9.

(Even in cryptographic hash functions collision happens, just that it is not easy to find colliding instances).

hash function is any function that can be used to map data of arbitrary size to fixed-size values. The values returned by a hash function are called hash valueshash codesdigests, or simply hashes. The values are usually used to index a fixed-size table called a hash table. Use of a hash function to index a hash table is called hashing or scatter storage addressing.

option c