Homework on Hash Functions - Questions

  1. Describe hash functions with your own words.

A hash function takes in an input and produces a unique string of characters for that input in such a way that there is no way to determine what the input is from just the output of the hash function.

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

In bitcoin, each block contains the hash of the data of the previous block. Any change to the data within a block would change its hash, which would then change the hash of all other blocks allowing for easy detection of any tampering in the blockchain, rejecting that blockchain within the network. Also miners use the hash of the current block being mined by concatenating a random string to it and checking if the hash of that is less than the current difficulty. Once a miner guesses the correct random string to solve that equation, they add that block to the chain and receive their reward.

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

It is possible for a unique input to share the same hash as another unique input. If you have a 128 bit hash, you would have a 50% chance of running into such a collision after 2^64 iterations with unique inputs. In order to reduce the rate of collisions you would need to use a higher bit hash function. For example, SHA 256 would require 2^128 iterations to have a 50% chance of running into a collision.

1. Describe hash functions with your own words
A: a function which deterministically converts input data into a certain fixed-size output according to cryptographic principles that make it technically impractical/nearly impossible to derive the input from the output.

2. How are hash functions used in cryptocurrencies like bitcoin?
A: in singing transactions, in deriving public keys from private keys, in deriving addresses from the public key and in blocks mining, which in turn ends up in the very construction of the blockchain

3. What does it mean when we say that hash functions need to be collision resistant?
It means it must be hard to obtain a same hash output from different inputs.

  1. A hash function is a function with a unique output and it is impossible to turn the output back to the input.
  2. To hash transactions? So no-one knows who sent money to who?
  3. Like I said before, this means every input has a unique output.
    :stuck_out_tongue_winking_eye:
  1. Each unique input gives a unique output. One-way function, input to output. not the other way around.

  2. If you slight change the input the output is completely changed. Unique hash value, high hashing speed and secure hash function are characteristics.

  3. It is very unlikely for two inputs to have the same hash output because of the cryptographic hash function, therefore collision resistant.

Describe hash functions with your own words
Hash function uses an algorithym to determine an 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).
A hash function is used to produce an encrypted identification of a transaction.

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).
If a hash function is not collision-resistant (there is no such thing as collision-free in hash functions because their output has a fixed length) then an adversary can break the function with little effort. More formally (but still quite informally):

1.) A hash function is a function that allways create the same output from the same input while at the same time creates an output that gives you zero information or hints about what the input was.

2.) It is used in the minig process where the hash function forces the miners to guess at random in order to mine a block. So the hash functions is an important part of the protocol that makes sure that real costly work is involved in mining a block.

3.) It means that different inputs will not create the same output. Or at least extremely rarely. Collision resistance means that you can be sure that data has not been altered if the hash output is the same.

  1. Describe hash functions with your own words

A function that gives a digit with a fixed length from any input.

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

Every block has a hash with data of its previous block. This gives a chain of all the blocks (blockchain). So when data is changed in one of the blocks by a potential hack, it’s hash and ALL corresponding block hashes will change. So it’s immediately visible that the data is not valid.

Bitcoin uses cryptographic hashes with a fixed set of zeroes of which the hash needs to have. Finding such hash can only be done by random guesses. So it takes some time to find a valid hash for a block. It takes a really really really… long time to find also the hashes of all following block. So it’s practically impossible to hack the blockchain.

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

A hash has a fixed length, so there are a fixed number of hashes possible for any input. Collision resistant means that there is an astronomical small change of a collision happening: 2 different inputs with the same output.

  1. A hash function is a solution to an equation that when placed into the algorithm provides you the input.
    2.In bitcoin the input is run through an algorithm and provides you with a string of 256 numbers and letters called the output.
    3.Collision resistant means that there is a low likelihood that any 2 or more inputs bring the same output.
  1. Hash functions protect the security of the transmission. It is a one way function that keeps the integrity of the data by creating a digital fingerprint as the output.
  2. Each blockchain transaction is taken as input and runs through a hashing algorithm, ( SHA-256 ) which creates an output, of a fixed length.
  3. Cryptographic hash functions are designed to be collision resistant. It is the attempt to find two input strings of a hash function that would produce the same hash result (output).
  • A hash function takes any string of data and converts it into 256 bits. This process is impossible to reverse and provides a unique identifier for your data.
  • In Bitcoin the Hash function is used to hash transaction data. Also mining and finding a nonce requires finding a number that generates a specified hash in combination with data unique to that block.
  • Collision resistant means two different things not getting the same hash.
  1. Hash functions are digital fingerprints. Where Each input gives auniq output. In hash functions we can og from input to output but, never from output to input. A hash function works only one way.

  2. In bitcoin hashfunctions are used to write new transactions trough mining. To solv a hash for bitcoin block it must start with 18 zeros. This is needed to slow down and not to mine all of the btc at once.

  3. There is a very low probability that two inputs generate te same output has. It is not impossible but a very smal chance of happening.

  1. Describe hash functions with your own words
  • A hash function produces a unique input and gives a unique output much like a fingerprint.
  1. How are hash functions used in cryptocurrencies like bitcoin?
  • SHA-256 is the hashing algorithm that Bitcoin uses. With SHA-256 along with Proof of Work this creates a unbreakable cryptographic code
  1. What does it mean when we say that hash functions need to be collision resistant?
  • Collision resistant makes sure that the same hash is always different from another hash and cannot be duplicated.
  1. Describe hash functions with your own words

Hash functions are central to cryptography. A hash function is a one way function. You can go from input >>> output. It is a one way process. It is not possible (feasible) to determine what the input was by working backwards from the output.Each unique input will ALWAYS produce a unique output, like a unique fingerprint. If you change the slightest thing, the resulting hash will be completely different.

  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 are central to securing a blockchain, and keeping an immutable record of all past transactions. Any new block created will contain a hash “pointer” of all the data from the previous block. If anybody tries the change any data in a block, the hash value of it and ALL SUBSEQUENT BLOCKS will change. All other nodes will reject the change because it does not match up with the hashes in their copies of the blockchain.

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

Because each unique input has a unique hash string output, the probability of producing the same output result from two different inputs is infinitesimally small (infeasible).

  1. Hash functions is one way function, where by knowing output you cant find input. And also each unique input gives unique output.
    and this one i find on internet that I think describes it the best: " A Hash or also called hash function is any algorithm that maps data of arbitrary length to data of a fixed length."
  2. Bitcoin uses the SHA-256 hash algorithm to generate verifiable “random” numbers in a way to require big amount of computing power to solve.
    And in blockchain each block contains hash of preview block to ensure security etc.
  3. Collision resistant means that 2 different inputs wont produce same output. if that happens - SHA25 will be broken?
  1. A hash functions stores certain data in its own way (for example SHA 256). The same input will give the same output and therefore it is possible to validate (if nothing has changed). On the other security side, due to the hashing it isn’t possible to receive the data based on this hashed output (would simply take too long with the computing power we have today).

  2. I think the data at the end of a block is stored as a hash (so people can’t get back or modify the data) but in the next block it is possible to check if the hash is the same and nothing has changed or manipulated.

  3. Collision resistant means that it is infeasible to find two inputs which will return in the same output (collision).

  1. Describe hash functions with your own words
    in a hash it is only possible to get from input to output and not the other way around. Makes a fingerprint

  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 function used in mining will verify the transactions in btc

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

two inputs cant have the same result on the output

  1. Hash functions can be used as means for encrypting messages and give signatures to stored data, in blockhain’s example, every transaction on the block , has its own unique hash code . It provides a large output of numbers/letters(same amount) for the input(any amount of words/letters), and is almost impossible to hack due to its large combination of letter/number code which would take a lifetime to hack making it unreasonable to attempt.

  2. In Bitcoins example which uses blockchain, the function of hashing is to give every block a specific signature and encrypt the data stored.

3.Collision resistance basically means that a hash function is at low odds of resulting in the same output from 2 same inputs. No hash function is collision “free”, but the higher the bit rate in a hash sequence the more collision “resistant” it will be.

  1. Hash functions are are a way to take an input and produce a unique digital fingerprint as an output, without being able to work backwards and figure out what the original input was. This is considered a one-way function. By hashing information, it is easy to tell whether the information has been tampered with, because tampering with the information will change the hash from the original unique digital fingerprint to a completely new hash.

  2. In cryptocurrencies, there is an underlying cryptographic hash function. For example in bitcoin, the hash function SHA-256 is used to produce unique outcomes. Specifically these cryptographic hash functions provide high levels of security for two reasons, they are unequivocal (meaning one cannot work backwards from from the unique output back to the original input) and they are also collision resistant (meaning that no two separate inputs should be able to produce the same identical output). This makes checking Data Integrity easier, as after computing the hash of a downloaded file and comparing that hash to a previously published file, if it was been tampered with it will be evident because the hash will be completely different.

  3. Collision resistance means that no two separate inputs should have the possibility to produce an identical output.

  1. Describe hash functions with your own words
    A hash function is a unique input which will generate a unique output. Any small change in the input will significantly change the output.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    Hash functions are used in bitcoin to copy information from one block to the next.

  3. What does it mean when we say that hash functions need to be collision resistant?
    It means that it should be impossible (or very low probabability) for two inputs to create the same output hash.

1 Hashing means taking an input string of any length and giving out an output of a fixed length. 2 with Bitcoin, the transactions are taken as input and run through a hashing algorithm (Bitcoin uses SHA-256) which gives an output of a fixed length.
3 A hash function is collision resistant if it is hard to find two inputs that hash to the same output