Homework on Hash Functions - Questions

  1. A hash function takes an input and creates a unique output to that specific input. You cannot take the output and then find the input.
  2. Cryptocurrencies like bitcoin use hash function in their algorithms to create the blocks on their blockchain. By using the hash functions they are making permanent non-reversible blocks which store their data.
  3. Hash functions need to be collision resistant (meaning nearly impossible to have two inputs create the same output). This is important because if different inputs could create the same output then you no longer would have a good “fingerprint” to use.
3 Likes
  1. A hash function is a function that is being used in computer programming.

  2. One of the main principles of Bitcoin and other cryptocurrencies is consensus. To get this consensus, a special hash function called proof-of-work (PoW) is being used. The PoW is basically a hash function.

  3. In the blockchain paradigm, there should not be two similar results from different inputs. Using the hash functions practically ensures that this would not happen. In other words, a hash function will never (or with an extremely low possibility) give identical results for different inputs that had been given it.

1 Like

Hash Function Answers

  1. Hash functions, a special type of function that can take many forms of data at its input, and produce a unique cryptographic identifier at its output. Mind you, this Hash function produces one of these unique cryptographic identifiers at its output for every unique piece of data supplied at its input. Any alteration no matter how minute is significant, for this produces a new cryptographic identifier at the output. Because of this divertive characteristic Hash functions perform like one-way valves, never allowing flow from output to input. Ensuring the integrity of the supplied data.

  2. Hash function essentially is what keeps the Blockchain, and thereby bitcoin(s) safe and secure. These very important building blocks are what bitcoins Blockchain uses to run its consensus mechanism. It is also vital to Bitcoin’s economic system implemented by its PoW function that’s based on an SHA-256 Hash function. Miners work to solve equations that would add new blocks to the blockchain, granted a successful verification of the hashes. It is this computational PoW that grants the exchange of new bitcoin to the winning miner.

  3. When two different inputs result in the same output that is referred to as a collision. When Hashing that should not happen because the result breaks the concept of hashing. Giving us a false sense of integrity on our data and like in the case of MD5 Hash allowing the opportunity to go from output to input. Although collisions are highly unlikely to occur even in Hash functions with lower message-digest, they are mathematically inherent in the Hash function. We can mitigate its effects by using a larger base message-digest than Hash functions like the MD5, SHA1, and SHA512 giving us more bits making a collision far less likier.

2 Likes
  1. A hash function is an algorithm that takes data of any length or size and converts it to a unique string of digits of fixed length. It has the important property of being non reversible so that the input cannot be derived from the output.
  2. In bitcoin the hash function is used to transform transaction data to a unique output that can be used to verify the data; also to produce public and private keys.
  3. Collision resistant means that it is almost impossible to find 2 inputs that produce the same output.
1 Like
  1. Describe hash functions with your own words
  • A hash function takes an input in any format, it could be numbers, letters or images and the output is created in Hash. Hash Function is unidirectional meaning, an input cannot be determined by using the output produced. A unique input will always create the same output but even a small change in the input will produce a completely different output in hash.
  1. How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now).
  • hash function in bitcoin is used to write the new transaction in the blockchain through the mining process. Mining process is to find the hash which starts with x number of zeros and meets the target difficulty.
  1. What does it mean when we say that hash functions need to be collision resistant? (We didn’t use the term “collision resistant” in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, that’s how you learn best).
  • Collision resistant means it is impossible for two different input to produce same output hash
1 Like
  1. A hash function takes an input and gives you one specific output per input. The beauty of hash functions is that the output should not be able to converted back to the original input.
  2. Hash functions are used in crypto specifically to write new transactions to the blockchain. The process of mining is used to solve these hash functions.
  3. From what I found doing research, a collision in terms of hash functions refers to getting the same output for 2 or more inputs. So collision resistance is how unlikely you are to receive the same output for 2 or more different inputs. ex. two inputs a and b where a ≠ b
1 Like
  1. Describe hash functions with your own words
    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 values ,hash codes, These codes are used to index a fixed-size table called hash table

Hash functions it is a mathematical process that takes input data of any size preforms an operation on it, and returns output data of a fixed size.

  1. How are hash functions used in cryptocurrencies like bitcoin?
    hash function in bitcoin protocol ,hash functions are part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining process.

  2. What does it mean when we say that hash functions need to be collision resistant?
    Collision Resistance : if it is hard to find two inputs that hash to the same output

If a hash function is not a collision-resistance , there is not such a thing a collision -free in hash functions because their output has a fixed length then an adversary can break the function with little effort

1 Like
  1. Hash functions are the process of taking unique inputs and producing unique outputs.
  2. In bitcoin, each block has an associated hash. Each blocks hash is based partly on the previous blocks hash. This way, each block refers to the block before it. Bitcoin branches transactions in blocks, and links them together in a chain.
  3. Collision resistance makes it hard to find two inputs that hash to the same output. Collision resistance doesn’t mean that no collision exist, but simply that they are hard to find.
1 Like
  1. Describe hash functions with your own words.

~ A hash function processes a input string of any length and gives an output with a fixed length, ultimately a one way function witch means that its impossible to go from an output to a input. Hash functions input has a unique identifier some say sort of like a digital fingerprint.

  1. How are hash functions used in cryptocurrencies like bitcoin?

~Hash Functions are used to create a bitcoin address from the private key and is used in Mining to create block hashes, produce a Merkle tree of all transactions.

  1. What does it mean when we say that hash functions need to be collision resistant?

~Collision resistant means that no two inputs will result in the same output.

1 Like
  1. hash function is taking the input (any data) and creates a 256bit output which is absolutely unique and can’t get the original input data out of it
  2. hash function in bitcoin is basically hiding the transaction data from the miners who need to find the right output to get the reward
  3. hash function is collision resistant if it’s very hard to get the same output from different inputs
1 Like
  1. Describe hash functions with your own words
    Answer: A hash function is a mathematical computation that takes an input of arbitrary size and produces an output of fixed size. For cryptographic hash functions the output is unique to each specific input and the function is ‘one-way’ meaning that it’s designed to be computationally infeasible with current technology/knowledge to glean the input from the output or for more than one input to have the same output. Some earlier hash functions such as MD5 fail these requirements and so are no longer feasible for cryptographic use.

  2. How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now).
    Answer: In the bitcoin protocol, hash functions are part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining process. In bitcoin mining, the inputs for the function are all of the most recent, not-yet-confirmed transactions (along with some additional inputs relating to the timestamp and a reference to the previous block). Ok, not totally my own words on this one ;)…

  3. What does it mean when we say that hash functions need to be collision resistant? (We didn’t use the term “collision resistant” in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, that’s how you learn best).
    Answer: A hash function is said to be collision resistant if it is very difficult(nearly impossible) to find two inputs that produce the same output.

1 Like

1- Hash functions only have one way- An input to an output, never the other way round.
2- Hash functions are to encrypt data on w secure way.
3- Collision resistant is a cryptographic function which is hard to find two inputs that hash to the same outputs.

1 Like

Hash Functions – Lesson 7 – Homework

Hash functions – Questions

¡ Describe hash functions with your own words

Hash functions are special functions where each input gives a unique output in the form of a unique digital fingerprint, which cannot be reversed to get back at the initial raw data.
or
In the abstract, a hash function is a mathematical process that takes input data of any size (= a string) , performs an operation on it, and returns output data of a fixed size (= the digest).
or
A hash is a function that converts an input of letters and numbers into an encrypted output of a fixed length. A hash is created using an algorithm and is essential to blockchain management in cryptocurrency.

¡ How are hash functions used in cryptocurrencies like bitcoin?

In the bitcoin protocol, hash functions are part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining process for which the miners get bitcoins as a financial incentive.

Hash functions are an essential part of, not only the bitcoin protocol, but of many cryptocurrency protocols and of information security as a whole in the form of cryptography.

Practical and common hash function application uses are:

  • Cryptocurrency transfer security (Cryptography)
  • Password verification and storage
  • Message and File verification/integrity checks
  • Digital signature generation and verification
  • Authentication
  • Information security applications

Three examples explained:

  1. Cryptocurrency transfer security (Cryptography)

Cryptographic hash functions are widely used in cryptocurrencies to pass transaction information anonymously.

  1. Storing passwords under the user accounts of f.e. a DeFi website or a Dapp. The websites/Dapp runs the password through a hash function before storing them. If a hacker gets the hashes he still can’t get to the passwords since the hashing ouput cannot be reversed to the input.

  2. Message and File verification/integrity checks (=security). This functions as a Data integrity check of a spreadsheet or a document. By hashing the spreadsheet or the document, any changes in the data will be detected if the hashing of the data (Input=string)) does not produce the same output (=digest).

¡ What does it mean when we say that hash functions need to be collision resistant?

If hash functions are not “collision resistant” the outputs may be reversible to get to the original data input, which would make the whole reason for hash functions redundant because input data would not be safe anymore (= hackable). This happened with MD5.

This means that no two input hashes should map to the same output hash. They can be hidden. It should be difficult to guess the input value for a hash function from its output.

In particular, cryptographic hash functions exhibit these three properties:

• They are “collision-free.” This means that no two input hashes should map to the same output hash.
• They can be hidden. It should be difficult to guess the input value for a hash function from its output.
• They should be puzzle-friendly. It should be difficult to select an input that provides a pre-defined output. Thus, the input should be selected from a distribution that’s as wide as possible.

1 Like
  1. Hash functions create an output that cannot be deconstructed to decipher the original input

  2. Hash functions are used to encrypt input information, making bitcoin permanent and unbreakable. The hashes are used for the creation of the coins through mining.

  3. No two different outputs can be from the same input

1 Like
  1. A hash function produces a fixed length output from an input that is unique and cannot be reversed to produce the input data.

  2. Used to validate the chaining of all transactions and histories on the ledger. once all is the same output and validated by all validators. it is confirmed on the ledger in an encrypted hash.

  3. If by remote chance that two inputs produce the same output, it becomes invalidated on the ledger.

1 Like
  1. A hash function is a function in which an input produces a unique output. We can’t figure out the input by having the output. It’s a one way function.

  2. Bitcoin uses hash functions to write new transactions into blockchain through mining. Hash functions are essential for bitcoin transaction security.

  3. Hash Functions collide when two random inputs give the same output. Collision resistance means that it makes it nearly impossible to have two inputs produce the same hash output.

1 Like
  1. Hash functions are one-way functions that have a certain input that give a fixed output. The input produces a given output, which can be determined by the input, but the output cannot determine the input. In this way, it is irreversible and provides a unique fingerprint or identifier for the data.
  2. Bitcoin uses hash functions to create a unique identifier for a transaction that cannot be reversed. They are used for transactions as well as for mining bitcoin through the use of block hashes, which create a unique ID for each block. Bitcoin further uses hash functions to help with the security of the chain because they can only work unilaterally from input to output.
  3. Collision resistance in bitcoin refers to the property that two different inputs will always produce a different output. Collision resistant is not collision free, however, though it is almost impossible for these collisions to occur because it is extremely difficult to find two input values that will produce the same output.
1 Like
  1. Describe hash functions with your own words

Hash Functions are one way functions, they are given an input and give back an unique output. It is not possible to reverse the function.

  1. How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now).

Hash Functions write down new transactions into the blockchain through the mining process.

  1. What does it mean when we say that hash functions need to be collision resistant? (We didn’t use the term “collision resistant” in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, that’s how you learn best).

Collision resistant means that it should not be possible that two different inputs create the same output.

1 Like

Describe hash functions with your own words
This is one-way function which creates a unique number for any given data. This function will always produce the same output for the same input. Basically it creates a fingerprint for the data.

How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now).
They are used to calculate a representation of a block.

What does it mean when we say that hash functions need to be collision resistant? (We didn’t use the term “collision resistant” in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, that’s how you learn best).
This means that two different pieces of data may never have the same output after hashing.
Data A (dA) -> Hash A (hA)
Data B (dB) -> Hash B (hB)
Data C (dC) -> Hash A (hA) -> COLLISION!

1 Like

It’s a one-way function. a unique input gives you a unique output.

In a cryptocurrency like Bitcoin, transactions are taken as input and run through a hash algorithm (Hash-256) which gives an output of a fixed length.

Collision resistance holds if it is practically impossible to find two inputs that hash to the same output.

1 Like