36 Lecture

CS403

Midterm & Final Term Short Notes

Hashing

Hashing is a process of converting data into a fixed-length value or key that represents the original data. It is used for various applications, such as data encryption, password storage, and digital signatures. Hash functions are designed to be


Important Mcq's
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. What is hashing? a) The process of encrypting data b) The process of converting data into a fixed-length value or key c) The process of compressing data d) The process of obfuscating data Answer: b What is a hash function? a) A function that converts data into a fixed-length value or key b) A function that compresses data c) A function that encrypts data d) A function that obfuscates data Answer: a What is the purpose of a hash function? a) To convert data into a fixed-length value or key b) To compress data c) To encrypt data d) To obfuscate data Answer: a Which of the following is an example of a hash algorithm? a) MD5 b) RSA c) AES d) DES Answer: a What is a hash collision? a) When two different inputs produce the same hash output b) When a hash function fails to produce a fixed-length value or key c) When a hash function is too slow d) When a hash function is too complex Answer: a Which of the following is an advantage of hashing? a) Hashing allows for easy reverse engineering of data b) Hashing provides secure encryption of data c) Hashing provides a fixed-length representation of data d) Hashing compresses data to save storage space Answer: c Which of the following is a common use case for hashing? a) Digital signatures b) Image compression c) Audio encoding d) Video transcoding Answer: a What is a rainbow table? a) A precomputed table of hash values and corresponding input data b) A method of decrypting hashed data c) A type of hash function d) A method of obfuscating data Answer: a Which of the following is a potential issue with using hash functions for password storage? a) Hash collisions b) Slow computation time c) Hash cracking through brute force attacks d) None of the above Answer: c Which of the following is a way to mitigate the issue of hash cracking through brute force attacks? a) Using a stronger hash algorithm b) Salting the password before hashing c) Increasing the size of the hash value d) All of the above Answer: b


Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. What is the purpose of hashing? Answer: The purpose of hashing is to convert data into a fixed-length value or key that represents the original data. It is used for various applications, such as data encryption, password storage, and digital signatures. How does a hash function work? Answer: A hash function takes an input (such as a password or data file) and produces a fixed-length output (the hash value) based on the input data. The hash function is designed to be one-way, meaning that it is computationally infeasible to reverse the process and obtain the original data from the hash value. What is a hash collision? Answer: A hash collision occurs when two different inputs produce the same hash output. This can be a security risk in certain applications, such as password storage, as it can allow an attacker to access sensitive data. What is a salt in the context of password hashing? Answer: A salt is a random value that is added to a password before it is hashed. This helps to prevent hash collisions and makes it more difficult for an attacker to crack the password through brute force attacks. What are some common hash algorithms? Answer: Some common hash algorithms include MD5, SHA-1, SHA-256, and SHA-3. What is a rainbow table? Answer: A rainbow table is a precomputed table of hash values and corresponding input data. It can be used to crack passwords by comparing the hash value of a password to the values in the table to determine the original password. What is a hash function collision attack? Answer: A hash function collision attack is a type of attack in which an attacker tries to create two different inputs that produce the same hash output. This can be used to circumvent security measures such as digital signatures. What is the difference between a cryptographic hash function and a non-cryptographic hash function? Answer: A cryptographic hash function is designed specifically for security applications and is much more difficult to reverse than a non-cryptographic hash function. Non-cryptographic hash functions are used for other applications such as data indexing and searching. What is the birthday attack in the context of hash functions? Answer: The birthday attack is a type of attack in which an attacker tries to find two different inputs that produce the same hash output. The name comes from the statistical probability of two people in a room having the same birthday. What is a hash tree? Answer: A hash tree is a data structure that uses hash functions to create a hierarchical representation of data. This can be used for efficient storage and verification of large datasets.

Hashing is a technique used in computer science and cryptography to convert data into a fixed-length value or key that represents the original data. This is accomplished by passing the original data through a hash function, which produces a hash value that is typically much shorter than the original data. Hashing has a wide range of applications, including data encryption, digital signatures, and password storage. Hash functions are designed to be one-way, meaning that it is difficult or impossible to reverse the process and obtain the original data from the hash value. This makes them a valuable tool for securing sensitive data. Hash functions are also deterministic, meaning that the same input will always produce the same output. This allows hash values to be used for data integrity checks, since any change to the original data will result in a different hash value. One common application of hashing is in password storage. When a user creates a password, it is passed through a hash function and the resulting hash value is stored in a database. When the user enters their password to log in, it is hashed again and compared to the stored hash value. If the hash values match, the user is granted access. This method of storing passwords is much more secure than storing them in plain text, as it makes it much more difficult for an attacker to obtain the original passwords. However, it is important to note that hash functions are not infallible. One potential issue with using hash functions for password storage is the risk of hash collisions, which occur when two different inputs produce the same hash output. This can allow an attacker to access sensitive data by guessing a password that produces the same hash value as the correct password. To mitigate this risk, a technique known as salting is often used. In salting, a random value is added to the password before it is hashed. This makes it much more difficult for an attacker to guess the correct password, even if they are able to produce a hash value that matches the stored value. Overall, hashing is an important tool for securing sensitive data and ensuring data integrity. While hash functions are not foolproof, they are a valuable tool for protecting against a wide range of security threats.