Homework on Hash Functions - Questions

Hash Functions are one way functions which transform input text to unique output (fingerprint)
Hash functions are used to encrypt the transaction data so its secure and only the intended recipient can decrypt it
Each input is transformed to unique output and probability of two different inputs transforming to same output is infeasible if not impossible

1 Like
  1. Hash functions are one way inputs that produce a specific output.
  2. Hash functions are used in cryptocurrencies like bitcoin in mining.
  3. Hash functions being collision resistant mean 2 different inputs produce the same output, which is really hard to do.
1 Like
  1. Simplest explanation, it is a function. You take an input of any length and it gives you a fixed output.
  2. Hash Functions are part of the block hashing algorithm. Which is used to write new transactions into the blockchain through the mining process
    3.Collision resistant is a hash function that is hard to find two inputs that hash to the same output.
1 Like
  • Describe hash functions with your own words
    A hash function returns the unique digital signature of a single unique digital input.

  • How are hash functions used in cryptocurrencies like bitcoin?
    In Bitcoin the SHA256 hash function is used in conjunction with merkle trees to ensure that transactions contained in each block remain unchanged and is the reason behind the Bitcoin blockchains immutability.

  • What does it mean when we say that hash functions need to be collision resistant?
    Hash functions should not return the same hash for different input data. If they do then it is called a “collision”. A hash should be unique to a single unique input data only. This is not always possible and no hash function at this point in time is completely collision free.

1 Like

1.) Hash functions are when a unique input generates a unique output, this output is called a fingerprint, if anything in the input is changed the entire output (fingerprint) is changed.

2.) In bitcoin hash functions are part of the block hashing algorithm, this is used by miners to write new transactions into the blockchain. In bitcoin mining the inputs for the function are the most recent transactions, ones not yet confirmed.

3.) Basically if a hash function is not collision resistant then it can be broken with little effort by an adversary.

2 Likes
  1. Describe hash functions with your own words
  • One-way functions that generate a fixed length string from any amount of data. If any bit in the data is changed, the output is 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).
  • A block containing transactions is hashed. A hash of the block is included in the next block, making it infeasible to change any transaction on the blockchain.
  • Hashing improves efficiency as you don’t have to drag old data along, you just save the hash.
  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 different inputs must not create the same output.
3 Likes
  1. A hash function takes a data set as input, and creates a unique fingerprint hash code as output. The hash code represents the data set as provided, any changes to the input data will drastically change the hash code output.

  2. Hash functions are used in cryptocurrencies like BTC to ensure security of transactions/data. The input data is hashed as an output fingerprint that represents the data set. The hash function is a one way operation. Data can be input and hashed to output, but the hash will not be able to be used as input that will render the data set as output.

  3. Given that a hash code is a fixed length, using a fixed amount of alpha numerical characters, there is a potential for two data sets to provide an identical hash. This would be characterized as a collision. Blockchains must be collision resistant to provide safety, security and stability of the data transferred within the chain. SHA-256 has a collision resistance value of astronomical proportions. While there is a possibility of collision, the probability of a collision is so low that it will take so many hashes, and therefore so much time, that the risk is minute. Bitcoin requires this for network integrity. This unique perspective found on Google compares the risk in perspective to chances of being struck by an asteroid:

"If we have a “perfect” hash function with output size n , and we have p messages to hash (individual message length is not important), then probability of collision is about p2/2n+1 (this is an approximation which is valid for “small” p , i.e. substantially smaller than 2n/2 ). For instance, with SHA-256 ( n=256 ) and one billion messages ( p=109 ) then the probability is about 4.310-60 .*

A mass-murderer space rock happens about once every 30 million years on average. This leads to a probability of such an event occurring in the next second to about 10-15 . That’s 45 orders of magnitude more probable than the SHA-256 collision. Briefly stated, if you find SHA-256 collisions scary then your priorities are wrong.

In a security setup, where an attacker gets to choose the messages which will be hashed, then the attacker may use substantially more than a billion messages; however, you will find that the attacker’s success probability will still be vanishingly small. That’s the whole point of using a hash function with a 256-bit output: so that risks of collision can be neglected.

Of course, all of the above assumes that SHA-256 is a “perfect” hash function, which is far from being proven. Still, SHA-256 seems quite robust"

Given the risk that a collision will crash a blockchain, the risk factor is so small it can basically be neglected…

2 Likes
  1. Describe hash functions with your own words.
    A hash function is a function that takes an input string of any length and gives an output of a fixed length.

  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 is used to write new transactions into the blockchain through the mining process.

  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). The hash function must be a one-way street for inputs and receive an output. It is infeasible to go from the output to the input, which makes that hash function collision resistant. If not, then it could be easily feasible to guess the original input, which makes that hash function not collision resistant.

2 Likes
  1. Hash functions are functions that take an input, and produce an output which is supposed to encrypt the input. Each value input inserted into the hash function produces a unique encrypted code. All encrypted codes are of equal length, but different values, regardless of their input.

  2. Hash functions are used to secure blockchain data and maintain network stability. By encrypting inputs, data is kept safe, while still being safe to share with users across the network to generate consensus. This is a core tenant of cryptocurrency, and its trustless nature.

  3. Collision resistance is the low likelihood of two separate inputs in a hash function producing the same output. In a hash function, collision would be h(a) = h(b) such that a=/=b. Hash functions need to be collision resistant so that the data integrity of the blockchain is maintained.

1 Like
  1. Describe hash functions with your own words
    Hash – a encrypted procedure using mathematical functions

  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).
    Bitcoin use sha-256 in mining and creation of addresses.

  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).
    It means that each unique input should have unique output, and it will take huge effort to hack the input.

1 Like
  1. Each unique imput results an unique output and you can go from imput to output but you can’t go from output to imput.

2.Hashing is one way to enable security during the process of message transmission when the message is intended for a particular recipent only. A formula generates the hash whitch helps to protect the security of the transmission against tampering.

  1. There are only 21 million bitcoins out there. If the miners are allowed to carry on, at this rate, they will fish out all the bitcoins in existence. On top of that, there needs to be a specific time limit in between the creation of each blocks. For bitcoin the time limit in between block creation is 10 mins. If the blocks were allowed to be created faster, it would result in more collisions: More hash functions will be generated which will inevitably cause more collisions.
1 Like

Hashing is generating a value from a string of text using a mathematical function.

E.g. Bitcoin, the transactions are taken as an input and run through a hashing algorithm SHA-256 which gives an output of a fixed length.

For the most part each input has it’s own unique hash.

1 Like

1.Describe hash functions with your own words
-Hash functions are an input,that gives a unique output (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).
-in Bitcoin youre transaction is the input that will be going through the SHA 256 algorithm that will give you the unique output.

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).
-That for the most part,each input will have its own hash and even that its not impossible,the chance an input will have 2 times the same output is very very low…almost impossible.

1 Like
  1. converts “message” into combination of numbers and letters , same message will always result in the same numbers. but you cannot decipher original message from numbers.
  2. private keys.
  3. you actually have covered this. property #6.
    It is “infeasible” for two inputs to have the same output. But NOT impossible. (bday paradox)
    you wouldn’t want the same output from 2 separate hash functions.
1 Like
  1. hash functions is a one way function product a unique input to a unique output and it cannot be reverse.

  2. Hash function in bitcoin is used for mining and verify the new transacation to make sure it is not duplicate.

3.Collsion resistant means 2 different data will never be able to have the same hash.

1 Like
  1. Hash functions allow me to input any given data and it gives an encrypted output of that input. Its a one way function where you cannot guess or figure out the input given the output.

  2. all the inputs, maybe like the text you can transform into code using sha-256, are transformed into this code thanks to sha-256 before getting stored on the block. This way every info can always, since saved on the blockchain, be attributed to the this one original input.

  3. It means that two different input will never give you the same output. So no possibility of missunderstandings as in language where a word can have several meanings f.ex

1 Like
  1. Hash functions are mathematical function in nature which are used to generate digital fingerprint as an output from any type of input.

  2. The SHA-256 algorithm is used by Bitcoin to generate random numbers which can be mathematically verified.

  3. It is difficult to find two colliding inputs, which have the the same output.

1 Like

A hash function is a cryptographic function which produces a unique output for every unique input. It always returns an output of fixed length regardless of the length of the input and small changes in the input cause big changes in the output.

There are many different types of hash functions, some examples are:

  • MD5 (not secure)
  • SHA-1
  • SHA-256

One feature of hash functions that are used in cryptocurrencies (like SHA-256) is that they have pre-image resistance. This means that you can’t work out what the input value was from the output value, that is, you can’t reverse the function. This makes the data that is hashed very secure. MD5 is a hash function which is no longer secure because people have worked out how to derive the input value from the output value.

Hash functions also provide a fingerprint for piece of data and since small changes in the input cause dramatic changes in the output, it is easy to verify whether data has been tampered with.

Which brings me onto collision resistance, it is very difficult to break the pre image resistance of a hash but breaking collision resistance is easier. Collision resistance says that given two different inputs its infeasible for their outputs to be the same. It means that every input has a unique output.

1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words

1.Answer
Hash function is SHA-256, which consists of an equation that can take any input and convert it into a constant output particular to the input only. In particular SHA-256 is virtually impossible to work back at this point in time- taking an output and trying to determine the input. This gives bitcoin, which uses this hash function a high security level against hackers.

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

2.Answer
Hash functions are used to create public key specifically in bit coin but can be used for encrypting any communication. Hash functions are also used in over all security in Bitcoin by converting new transactions which can be recorded as hashes in a ledger. It is used in bitcoin to gain bitcoin as a reward in mining.

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

3.Answer
Simplistically put It means that is need to be very hard for any 2 inputs to have the same output, the sheer scale of the possibilities of SHA-256 makes it virtually impossible due to the randomness for any 2 inputs to have the same output and even if it did it would probably be so far removed from the last input output it would not matter.

1 Like
  1. Hash function is one way function what means that input can´t be found from output.
  2. Hash function in bitcoin works in mining. The inputs are unconfirmed transactions, to solve a block miners combine all inputs together with the data of their own. Blocks contain hashes of the previous block in the chain.
    3.Collision resistance means that it is hard to find two inputs that hashes the same output.
1 Like