Homework on Hash Functions - Questions

  1. Hash functions are special functions where you insert something you get a unique fingerprint and finding the initial input by another user is not likely.

  2. Hash functions are used in cryptocurrancies like bitcoin to establish a blockchain.
    This is performed through mining. When software wants to add a new block to the blockchain, this is the procedure it follows. Whenever a new block arrives, all the contents of the blocks are first hashed. If the hash is lesser than the difficulty target, then it is added to the blockchain and everyone in the community acknowledges the new block.

However, it is not as simple as that. You will have to be extremely lucky to get a new block just like that. This is where the nonce comes in. The nonce is an arbitrary string that is concatenated with the hash of the block. After that this concatenated string is hashed again and compared to the difficulty level. If it is not less than the difficulty level, then the nonce is changed and this keeps on repeating a million times until finally, the requirements are met. When that happens the block is added to the blockchain.

Hash rate basically means how fast these hashing operations are taking place while mining. A high hash rate means more people and software machines are taking part in the mining process and as a result, the system is running smoothly. If the hash rate is too fast the difficulty level is increased. If the hash rate becomes too slow then the difficulty level is decreased. (blockgeeks.com)

  1. In cryptography, 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 where ab but H ( a ) = H ( b ).[1]:136 The pigeonhole principle means that any hash function with more inputs than outputs will necessarily have such collisions;[1]:136 the harder they are to find, the more cryptographically secure the hash function is. Wikipedia
3 Likes

Agree. I feel like the concept fo ECC vs SHA256 confuses alot of people. @ivan @filip

We understand this is confusing for some and its understandable. Cryptography is a huge topic and people are studying it their entire lives and still don’t get it :smiley:
That’s why we are here to help out students to understand the basic difference between the two. :slight_smile:

1 Like
  1. Hash functions give unique digital fingerprint as output and it is impossible to find out what the input of that output was. They are one way functions.
  2. Still new to all of this, but from my understanding hash functions allow us to store all the data that we want to save and keep track of. No mater how big it is. And for that unique input of data, hash function always produces the same hash, same output. Each block has a hash of its own data plus the hash of the data of the previous block. Together they have a new hash that gets inside the next block. That way a chain is formed and in that chain nothing can be changed otherwise it automatically changes everything else. So if unique data gets its unique hash it means a cryptocurrency like Bitcoin can not be copied and someone can not claim they have x amount of Bitcoin unless you can see a proof of that in the blockchain. All of that thanks to hash and hash function.
  3. It means that the chances of two hash being same but with different input should be very low. I think that is why Bitcoin block is mined every 10 minutes.
1 Like
  1. In simple terms, hashing means taking an input string of any length and giving out an output of a fixed length.

  2. In the context of cryptocurrencies like Bitcoin, the transactions are taken as input and run through a hashing algorithm such as SHA256 to produce an output of a fixed length.

3.If there are 2 different inputs A and B and we assume H(A) and H(B) are their respective hashes, it is infeasible for H(A) to be same as H(B), and each input will have its own unique has “for the most part”. The only exception to this rule will be “The Birthday Pardox”. Because of “The Birthday Paradox”, no hash function is collision free, but it usually takes so long to find a collision.

1 Like

Q: Describe hash functions with your own words
A: Hash functions are functions which takes an input and produces a hashed output. Giving this function the same input will always result in the same hashed output

Q: 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: Hashing functions are used during the “mining” process where a bunch of transactions are lumped together, including some random data and then a hash is generated. If it matches a given hash then you win the block reward.

Q: 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: This means that the function must try and NOT produce the same output when it has been given 2 different inputs.

1 Like
  1. Hash functions process data of any size into hash values of a fixed length, and they are impossible to invert.
  2. When used with cryptocurrencies, hash functions take a transaction as an input, and compute its hash value, which is a unique number like a fingerprint, so that it can be recorded in the blockchain ledger. These hash functions must meet three requirements: 1. Pre-image resistance - It is infeasible to reverse a hash function and determine what the input was. 2. Second pre-image resistance - it should be difficult to find more than one input with the same hash value. 3. Collision resistant - it should be difficult to find two different inputs whose hash values are the same. hash functions are also deterministic, meaning that the same input always results in the same hash value. It is also true that computing a hash value from any input will be a quick process.
  3. Expanding on a hash function meeting the requirement of being collision resistant, this requires 2nd pre-image resistance, but not necessarily pre-image resistance. It also requires hash values to be at least twice as long as that required for pre-image resistance.
1 Like
  1. Hash functions are mathematical algorithms that take an input of any size and convert into into a string of fixed size. Each unique input deterministically produces a unique output, and any small change results in the entire output being affected. They are non-reversible and practically infeasible to crack by brute force, due to the amount of time and computational power needed.

  2. Hashing is used to implement Bitcoin’s Proof of Work, which facilitates miners including transactions onto new blocks in exchange for a reward.

  3. “Collision resistance” refers to the property by which no two inputs to a hash function can produce the same hash.

1 Like
  1. Hash function is an action/function applied to a set of data. For every input that is given, it will give an unique output for it (digital fingerprint).

  2. Hash functions are used for every transaction and the output data is stored in a blockchain. As the output is always different, it provides the encryption character which is needed.

  3. Each input will have it’s own unique hash output so 2 inputs should never have the same output. This means that it is is highly uncertain that 2 outputs are equal

1 Like

A hash function is a function which when given a key, generates an address in the table. The example of a hash function is a book call number. Each book in the library has a unique call number. … The later is always possible only if you know (or approximate) the number of objects to be proccessed.

A hash function is a function which when given a key, generates an address in the table. The example of a hash function is a book call number. Each book in the library has a unique call number. … The later is always possible only if you know (or approximate) the number of objects to be proccessed.

A Hash Collision Attack is an attempt to find two input strings of a hash function that produce the same hash result. If two separate inputs produce the same hash output, it is called a collision .

1 Like

Homework on Hash Functions - Questions

1.Describe hash functions with your own words.

A has function is a unique 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 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.

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

A hash function is collision resistant if it is hard to find two inputs that hash to the same output.

1 Like
  1. A mathmatical algorithm that maps data of arbitrary size to a bit array of fixed size.

  2. In Bitcoin protocol hash functions are part if the block hashing algorithm which is used to write new transactions into the blockchain through the mining process.

  3. A hash function is collision resistant if it is difficult to find two inputs that hash to the same output.
    This is more likely if there are more inputs than outputs.

1 Like
  1. Hash functions are functions that are one way. Meaning there’s no way to tell what input you used to get your output by only having the output. Making them secure.

  2. Hash functions are used by bitcoin by creating a different hash output for each transaction that is always different. You can make the slightest change to the input and the output will be a totally different hash number. It also makes bitcoin secure because of the time it takes to brute force the function. Hash functions make bitcoin what it is basically.

  3. They need to be collision resistant because you never want two different inputs creating the same output. Since the hash length is so long for bitcoin it’s infeasible that they will collide. Meaning it will take so long for two different inputs to achieve the same output that it doesn’t even matter when using the SHA-256 hash functions.

1 Like

A hash function takes a string of any length and produces a fixed length string that is unique to the input and will always hash to the same output from the same input.

They are used to produce public and private keys used to identify an account. Also they are used in mining so the hash of a previous block is used to mine the next block.

It is very improbable that two different inputs would have the same hash. It is possible but so remote that it is reasonable to assume that it would never happen.

1 Like
  1. Hash functions are a function that each unique input you put into it, you will get a unique output.

  2. they are used in cryptocurrencies like bitcoin as for one giving the fingerprints of each coin. they are also used in mining. “to solve a block” miners will try to combine all the inputs with the input data they’ve collected over time in such a way that resulting hash starts with a certain number of zeroes.

  3. It means that it must be very hard for more than one input to get the same output.

1 Like
  1. One-way functions that produces an unique output from an input.
  2. Used for the mechanics of mining (creation of new BTC).
  3. Two different inputs should not result into the same hash output.
1 Like

The elliptic curve function is used to derive public keys. :slight_smile:

1 Hash function are a way to encrypt things digitally one way where it is next to impossible to go from output to imput. The same inputs always have the same outputs. The outputs are of fixed length no matter the size of the inputs and contain many properties including the ability to very data integrity without actually seeing any of it and creating digital fingerprints.

2 Hash functions are used in the blockchain not only for security and the benefits of hashing transactions, but also for mining. Miners are executing 3 billion billion hash functions per second trying to find a hash that contains a certain amount of zeros. Usually every 10 minutes on bitcoin, a miner is successful and then creates a new block on the blockchain.

3 Hash functions need to be collision resistant so that it is next to impossible for two inputs to have the same hash output.
.

1 Like
  1. hash functions a mathematical operations that give a unique output from a given input. There is no required length of input, but there is a fixed length for the output to the given hash function.
  2. hash functions are used to write new transactions into the blockchain through the mining process. 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). The bitcoin proof of work mechanism makes use of the crucial cryptographic hash function property “small changes in the input changes the hash”. Miners try to combine all of the inputs with their own arbitrary piece of input data in such a way that the resulting hash starts with a certain number of zeroes. Since an output with a lot of zeros must be achieved, it takes a lot of effort to mine bitcoin. Thereby enabling bitcoin harness the puzzle friendly, and deterministic properties. (see - https://www.coindesk.com/bitcoin-hash-functions-explained)
  3. It is infeasible to have two different inputs give the same output
1 Like

1),The mathematical algorithm that is used to has an input (message) is the has function and, it gives as output the has value which have a unique fingerprint that can’t be reversed.

  1. Hash functions helps the bitcoin blockchain to be immutable
    decentralized, and secure.Also are used for several security applications, such as message authentication codes, e-commerce protocols, and digital signatures.

  2. “collision resistant” is a security notion of cryptographic hash functions. Is a pair of different inputs which give the same output.Collision resistance makes it hard for someone to invent two messages(inputs) that will generate the same hash and is a much harder property to fulfill in a hash function.

1 Like