Homework on Hash Functions - Questions

  1. Hash Functions are mathematical formulas that produce a unique output to a given input and is irreversible, meaning that the resulting hash cannot be used to reveal the given input.

  2. Hash functions are a fundamental component used in cryptocurrencies to guarantee the integrity of the transactions contained in each block and each previous and subsequent block in what is described as the block-chain. Specifically, they are used to condense data to a fixed size, to identify, compare or run calculations against files and strings of data. Also, public and private keys, a necessary component in cryptocurrencies like Bitcoin, use hash algorithms to validate and identify users, transactions and their wallets.

  3. Because of the Pigeonhole principal, some inputs will hash to the same output. Collision Resistance expresses the likelihood of this happening on two different nodes of the network.

1 Like
  1. In a hashfunction you can only go from input to output. Your output will always be 256 bit if you use SHA-256

  2. Hashfunctions are used to encrypt the transaction data. Every transaction will be hashed together with the hash of the previous block to create the next block.

  3. Collision resistant means two different inputs not getting the same hash.

1 Like
  1. Hash functions are mathematical equations based on the generation of values with the function having an output from an input. Also, the input in this function is impossible to determine based on the output due to the input having a high randomness.

  2. Hash functions are used for the discovery of new blocks of data that are added to previous block chain.

  3. Collision resistance needs to occur in hash functions so that no two inputs will equal the same output and thus difficult to determine the output of a function based on its input.

1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    It’s a function that takes an of strings (of any length) and gives an output of a fixed length in order to protect message transmission.
  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).
    They are used to secure the information stored on the blockchain from being tampered with by encrypting the information so that it is non-revertible, and figuring out the the hash function is ā€œunfeasible.ā€
  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).
    ā€œgiven two different inputs A & B where h(A) and h(B)are their respective hashes, it is infeasible for h(A) to be equal to h(b),ā€ In essence, each input will have its own unique hash output.
1 Like
  • Describe hash functions with your own words
    It’s a function that generates a fixed and easily reproducible number from any input.
    The output is always the same, given the same input.
    And it’s impossible to reproduce input from the output.

  • 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).
    The hash of the previous block and other hashes are combined to produce a new hash in the next block that’s easily verifiable.

  • What does it mean when we say that hash functions need to be collision resistant?
    It’s hard to find another (differen) input that generates the same output

1 Like
  1. hash functions contain various forms of encyption settings. The popular one used in bitcoin is SHA-256. Any kind of input data is converted to a unique output. The reason SHA-256 is used is that you can not determine in the input from only knowing the output.

  2. Hash functions are used in crypto for actions like mining. Essentially hash functions are what are used to unlock new blocks to be added to the blockchain. As more people get involved in the mining process the hash rate increases making the problem difficulty harder to solve.

  3. That two inputs can not hash to the same output. And although not impossible are highly improbable. Putting limits on length of time of solving these problems helps from running into these problems.

1 Like
  1. In my own words-- hash functions take written text and assign numbers and letters of varying length to assign the text a secure output code that identifies the authenticity of the original inputted text.

  2. " …the transactions are taken as input and run through a hashing algorithm which gives an output of a fixed length." Blockgeeks .com

  3. Collision resistance is property of two inputs that can be cryptographically hashed and not have the same output. H(a) = H(b) a is not equal to b.
    H(Blah, blah, blah) = H (blah, blah blah) a is not equal to b, I think… blah.

1 Like
  1. Hash functions take input information and convert it to a predefined unique output. This process goes in one direction only and cannot be reversed.
  2. In cryptocurrencies, hash functions are used to mark all transactions when they are added to blockchain and to give them unique mark.
  3. Collision resistant means, that two distinct input data for hash function, will always give two distinct output information, never the same.
1 Like

LOL, A collision just means that 2 different inputs create the same output wich is very bad. But in Sha256, the chances to have a collision are verrrry small

1 Like
  1. A hash function is a function which can be used to turn data of arbitrary size to fixed-size values after the operation.

  2. It is to verify that the blocks have not been tampered during the transmission, and hence helps providing the genuineness and integrity of the blockchain.

  3. Collision resistant means it is hard to find two inputs that hash to the same output. Hash functions need to be collision resistant, or otherwise users could provide hash collisions as proof to cheat the system, or attacker could use a different set of data to produce the same hash and trick users.

1 Like
  1. Hash functions are a way of converting inputs through a mathematical process into a codified output
  2. Hash functions in crypto convert transactions into a codified output which can be stored into the blockchain
  3. This means that chance is very low that two different inputs hash into the same output.
1 Like
  1. Hash functions are strictly oneway functions that goes from input to output and can’t go from output to input, a uniqe input that gives you and uniqe output(digital fingerprint).

  2. By taking the input(transaction) and hash it using the SHA-256 to get a uniqe output of fixed length(digital fingerprint) .

  3. It needs to be very hard for two different inputs to give the same output, for instance if two inputs give the same output(hash) it means you can cheat the system because it’s not collision resistent. Even if it’s collision resistent it doesn’t mean it totally safe, but it’s very hard to find the same output(hash) for two different inputs.

1 Like
  1. They are functions that give a unique output for a unique input and can’t move from output to input.
  2. The data of the transaction is hashed and stored on blocks
  3. it means that 2 unique inputs can give the same outputs. this needs to happen so all transactions can be safely encrypted.
1 Like

If this would happen it would pose a security issue. It is possible, but due to the size of all possible outputs highly unlikely. :slight_smile:

1 Like
  1. Describe hash functions with your own words A one way function that will always have a unique hash output, to match with a unique hash input. You cannot determine the input with the output.
  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).Hash functions connect the blocks in the Bitcoin blockchain and are the basis for securing the growing cryptographic network.
  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). SHA-256 is collision resistant because there is only a 2^256 chance that multiple unique hash inputs will ā€œcollideā€ and have the same hash output.
1 Like

When two inputs result in the same output, isn’t that a collision?

  1. Hash functions are functions which give unique output for each unique input. It is almost impossible to know the input from the output.

  2. BTC uses hash functions in mining. I would say that it’s function is Y > H(k|x), where x = hash of the block, k = nonce (random number which is found during mining process) and Y = difficulty level. This means that hash has been taken and random number nonce has been added to the hash string to see if this string is less than the difficulty level. If yes, the puzzle has been solved. If no, searching continues.

  3. Hash functions are collision resistant because if you take inputs A and B where H(A) and H(B) are their hashes, it is almost impossible for H(A) to be equal to H(B). For each unique input the output will be different, but there is still very small possibility for them to collide. Although it is small, it still exists.

(I would really appreciate it if someone could comment on my 2nd answer to be sure that I understood everything correctly. Thanks!)

1 Like

[quote=ā€œivan, post:1, topic:8430ā€]

  • Describe hash functions with your own words-

Hash functions create a unique output any changes to the input will provide a new out put hash code.

  • 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).

In In the context of cryptocurrencies like bitcoin, the transactions are taken as input and run through a hashing algorithm which gives an output of a fixed length.

  • 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 resistance is a property of cryptographic hash functions : a hash function H is collision resistant if it is hard to find two inputs that hash to the same output; that is , two inputs a and b such that H(a) = H(b), and a ≠ b.

1 Like
  1. Hash functions are relationships that take in a variable-length input and produce a fixed-length output.

  2. The hashing function takes as input the contents of the current block plus the hash function of the contents of the previous block.

  3. If the number of elements of a function’s output is fixed and the input is of variable length, it is possible to find the same output for different inputs. Collision resistance refers to the function’s low probabilities of producing the same output from two different inputs.

1 Like

Correct, but that wasn’t clear from the answer :slight_smile: