Hashing

Description: Hashing is a fundamental concept in computer science, cryptography, and data structures. It involves converting a large set of data into a smaller, fixed-size value called a hash. This quiz delves into the intricacies of hashing, covering various techniques, applications, and security aspects.
Number of Questions: 14
Created by:
Tags: hashing cryptography data structures security
Attempted 0/14 Correct 0 Score 0

What is the primary purpose of hashing?

  1. Compressing data

  2. Encrypting data

  3. Generating unique identifiers

  4. Verifying data integrity


Correct Option: C
Explanation:

Hashing is primarily used to generate unique identifiers for data items, enabling efficient searching, indexing, and comparison.

Which hashing algorithm is widely used for password storage?

  1. MD5

  2. SHA-1

  3. SHA-256

  4. SHA-512


Correct Option: C
Explanation:

SHA-256 is commonly employed for password storage due to its strong cryptographic properties and resistance to collision attacks.

What is a collision in the context of hashing?

  1. When two different inputs produce the same hash value

  2. When a hash function is not able to generate a hash value

  3. When a hash value is too long

  4. When a hash value is too short


Correct Option: A
Explanation:

A collision occurs when two distinct inputs generate the same hash value, leading to potential security vulnerabilities.

Which hashing algorithm is commonly used in blockchain technology?

  1. MD5

  2. SHA-1

  3. SHA-256

  4. SHA-512


Correct Option: C
Explanation:

SHA-256 is extensively used in blockchain technology due to its ability to generate secure and tamper-proof hashes for blocks, ensuring the integrity of the blockchain.

What is the main advantage of using a hash table data structure?

  1. Fast searching and retrieval

  2. Efficient storage utilization

  3. Reduced memory usage

  4. Enhanced security


Correct Option: A
Explanation:

Hash tables excel in providing constant-time lookup and retrieval operations, making them highly efficient for searching large datasets.

Which hashing technique is commonly used for load balancing in distributed systems?

  1. Consistent hashing

  2. Linear hashing

  3. Quadratic hashing

  4. Double hashing


Correct Option: A
Explanation:

Consistent hashing is widely used in distributed systems to distribute data across multiple nodes in a consistent and predictable manner, ensuring even load distribution.

What is the purpose of a salt in password hashing?

  1. To increase the length of the password

  2. To make the password more complex

  3. To prevent rainbow table attacks

  4. To generate a unique hash value


Correct Option: C
Explanation:

Salting is a technique used in password hashing to prevent precomputed attacks like rainbow tables by adding a random value to the password before hashing, making it more difficult to crack.

Which hashing algorithm is suitable for generating message digests?

  1. MD5

  2. SHA-1

  3. SHA-256

  4. SHA-512


Correct Option: C
Explanation:

SHA-256 is commonly used for generating message digests due to its strong cryptographic properties and resistance to collision attacks, making it suitable for ensuring data integrity and authenticity.

What is the main disadvantage of using linear probing in hash tables?

  1. Increased collision probability

  2. Reduced search efficiency

  3. Higher memory usage

  4. Slower insertion and deletion operations


Correct Option: A
Explanation:

Linear probing suffers from increased collision probability as it linearly searches for an empty slot to insert a new element, leading to potential clustering and reduced search efficiency.

Which hashing algorithm is suitable for generating cryptographic hashes?

  1. MD5

  2. SHA-1

  3. SHA-256

  4. SHA-512


Correct Option: D
Explanation:

SHA-512 is widely used for generating cryptographic hashes due to its high level of security and resistance to collision attacks, making it suitable for applications requiring strong cryptographic protection.

What is the purpose of a hash function in a hash table?

  1. To generate unique keys for data items

  2. To distribute data evenly across the hash table

  3. To search for data items efficiently

  4. To store data items in a compact manner


Correct Option: B
Explanation:

The primary purpose of a hash function in a hash table is to distribute data items evenly across the table, reducing collisions and improving search efficiency.

Which hashing technique is commonly used for resolving collisions in hash tables?

  1. Chaining

  2. Linear probing

  3. Quadratic probing

  4. Double hashing


Correct Option: A
Explanation:

Chaining is a widely used technique for resolving collisions in hash tables by creating linked lists for each hash table slot, allowing multiple elements to occupy the same slot.

What is the main advantage of using double hashing in collision resolution?

  1. Reduced collision probability

  2. Improved search efficiency

  3. Lower memory usage

  4. Faster insertion and deletion operations


Correct Option: A
Explanation:

Double hashing reduces collision probability by using a secondary hash function to determine the next slot to probe in case of a collision, distributing elements more evenly across the hash table.

Which hashing algorithm is suitable for generating fingerprints for files?

  1. MD5

  2. SHA-1

  3. SHA-256

  4. SHA-512


Correct Option: C
Explanation:

SHA-256 is commonly used for generating fingerprints for files due to its strong cryptographic properties and resistance to collision attacks, making it suitable for verifying file integrity and detecting file tampering.

- Hide questions