Question #1. Describe hash functions with your own words.
Hash function takes an input that could be text or numbers and outputs a unique digital finder print that is unique for the text and number entered. You can hash the same input many times and the same output will be given to you. Although, you canât reverse engineer hash functions for security because they donât look like input. SHA-256 that is used by bitcoin.
Question #2. How are hash functions used in cryptocurrencies like bitcoin?
Hash functions are used in cryptocurrencies like Bitcoin to ensure that input can never be unlocked by looking at the output. Hash function in bitcoin uses SHA-256 that was developed by NSA in the USA.
All digital information like numbers and letters get gets converted into digital bits and it is pushed into hash function to get converted again to receive an output. It is secure.
Question #3. What does it mean when we say that hash functions need to be collision resistant?
"Hash algorithms are often used for computing digital signatures. The signer of a message runs the original message through a hash algorithm to produce a digest value, then encrypts the digest to produce a signature. Someone verifying the signature will run the message through the same hash algorithm, and will decrypt the attached signature value to ensure the digest it contains matches the one they computed.
If collisions are easy to find, they allow an attacker to take an authentic digitally signed message, find a different message that produces the same digest (the collision), then substitute the fake message for the real one while keeping the same signature value. Someone trying to validate the signature wonât be able to tell the difference. This destroys the value of digital signatures.
Testing is difficult. You can apply chi-squared tests and look for uneven digest bit distributions over a wide number of single- and multi- bit changes, but thatâs not proof. Most of the strength relies on the algorithmâs resulting digest size being large enough to mask any undiscovered weaknesses."