Homework on Hash Functions - Questions

Homework on Hash Functions - Questions

Describe hash functions with your own words

1 Each unique input creates a unique output

You can go from input to output but you can’t go from output to input

1 way function

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

This is what I found

taking an input string of any length and giving out an output of a fixed length. 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.

Bitcoin mining uses cryptography, with a hash function called double SHA-256. A hash takes a chunk of data as input and shrinks it down into a smaller hash value (in this case 256 bits). With a cryptographic hash, there’s no way to get a hash value you want without trying a whole lot of inputs.

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 is what I found

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

A collision of a hash function is a pair of different inputs which give the same output. In the new definition, weak collision resistance means that the probability of failing to find a collision is not negligible. This weak collision resistance is then analyzed.

1 Like
Describe hash functions with your own words

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

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).
  1. A hash function takes any unique input and encrypts it into a unique output, as a digital fingerprint of this input.

  2. Hash functions are used for mining. Computers try to solve hashing puzzles and getting rewarded with bitcoin when a new block is added to the network.

3)Hashing functions should be able to produce unique output for every kind of input parameter. 2 similar outputs for different input would create a “collision”

1 Like

Collision resistance occurs when two inputs result in the same output, which can be found using brute force but still highly unlikely.

1 Like
  1. Hash functions take an input (data) and create a unique hash directly tied to that input. Any small changes to the input and the hash that is output completely changes.

  2. Blockchain is a linked list that contains data and a hash pointer that points to the previous block, this creates a chain. The hash pointer holds the address to the previous block along with a hash of the data inside the previous block. This means any small changes to any of the data in any block will drastically change the hash that is output.

  3. Each unique input will have its own respective hash, no hash should be tied to multiple inputs. Using SHA-256 collision is not impossible but rather it would take so long to happen it is infeasible.

1 Like

1. Describe hash functions with your own words
Hash functions are one-way functions, generating for each input a digital fingerprint.

2. How are hash functions used in cryptocurrencies like bitcoin?
Each block contains hash of a previous block, transaction data is hashed, mining requires finding nonce that together with block hash generates a specified hash.

3. What does it mean when we say that hash functions need to be collision resistant?
The probability of generating same hash for different input should be minimal.

1 Like

1.A function that gives a input a unique output that cants be reversed to figure the input from the output
2.Part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining process
3. Each input will have its own unique hash so it is very unlikely of a hash outputting the same hash for 2 different inputs

1 Like
  1. Hash functions is a unique digital fingerprint that acts as a dta integrity check. Th einput data always result in a fixed-size output data.
  2. Hash functions are used in cryptocurrencies like bitcoin to remain decentralized and secure.
  3. A has is collision resistant if it is hard to find two inputs that hash to the same output.
1 Like
  1. Hash functions are one way functions where input has a unique output.

  2. Bitcoin uses hash functions in the mining process.

  3. Collision resistant means that it is really difficult or impossible to get the same output for two or more different inputs.

1 Like
  1. A hash function is a function that make it near impossible to find the input data from the output information.

  2. bitcoin uses hashes in the mining process and block hashing algorithm

  3. that a hash function needs to have resistance from different inputs having the same output or fingerprint

1 Like

I thought that the sha256 is hashed down to a 16 digit number for easier storage/transportation thru network? Did I misread the question?

  1. Describe hash functions with your own words

Computational function that converts any input into an alphanumerical string of fixed length.

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

Has functions are used in blockchain technologies to create the links between the blocks. Where they are used as hash pointers, that indicate the address of the previous block as well as the hash of the data, to leverage immutability.

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

This means that two different inputs need not to have the same output through hashing.

1 Like
  1. Each unique input gives a unique output.

  2. All properties of the cryptographic hash functions needs to be fulfilled, then it considered to be secured for it adoption/use in cryptocurrencies, i.e. deterministic, quick computation, pre-image resistance, immutability, collision resistant and puzzle friendly.

  3. two inputs can not produced the same output, the significant word here is “infeasible” instead of impossible.

1 Like

hash functions are a one way function that is complex but easy to show results where any string of input has a fixed output result like a digital fingerprint

in bitcoin hashing is one way to enable security during the process of message transmission when the message is intended for one particular reciepient only. This formula generates the hash which helps as a security measure against being tampered with.

we mean two input functions cannot have the same hash

1 Like

Users see the hexadecimal conversion of a 32Byte hash (wich are 64 hexadecimal digits)
bits are binary. (Zero or 1)
A Sha256 hash has 256bits (256 1 and zero’s)
Converted to hexadecimal = 64 digits.

1 Like
  1. Hash function is a function that takes in an unique input value and returns an unique output value; it is one-way function from input to output but can’t be reversed.
  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 means it is hard to find two inputs that hash to the same output.
3 Likes
  1. hashing function takes a input string of arbitrary length and turn into a hash code of fixed size.

  2. bitcoin uses cryptographic hash function that generate a hash code from any arbitrary length input string. the cryptographic hash function is a one way hash, meaning there is no way to determine the input string from the output hash, except for brute force trial and error from by trying all input combination and compare the resultant hash code. This makes bitcoin highly secure and immutable.

  3. Collision resistant means its highly unlikely for two unique input string to return with the same hash code. Hence you can safely assume there is a unique input string for a given hash code, practically.

1 Like
  1. Hash functions are one way functions, that means that for every input you can compute an output, but you cannot compute an input value from the output value (it is not impossible, but it is infeasible). A hash function gives a unique output (i.e. digital fingerprint) for every input. If you change (even slightly) the input value, the resulting output hash value is completely different.

  2. Hash functions outputs are “used to link the blocks in the blockchain together.” The data of a particular block is hashed. A block also contains a hash pointer to the previous block and so on. It is also used in mining, which means searching for a new block to be added in the blockchain. 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.

  3. Collision resistant means that two different hash inputs cannot result in two identical hash outputs. This is infeasible but not impossible, which means that no hash function is truly collision free (The birthday paradox). It usually takes so long to find that collision so it doesn’t even matter

2 Likes
  1. Hash functions are used to secure information (Information Security).
    Hash functions are a mathematical computation which generates a fixed short fingerprint of an input of any size.
    Cryptocurrency such as Bitcoin, use SHA-256 which generates a 64 digit output with a combination of letters and numbers. Etherium uses the cryptographic hash function called Keccak-256.

  2. In Bitcoin hash functions are used to write new transactions into the blockchain through the mining process.

  3. Collision resistance insinuates that for any given input, there must not be another input which can harness or generate the same identical output.

1 Like

Describe hash functions with your own words?

Returns a string containing the calculated message digest as lowercase hexits unless raw_output is set to true in which case the raw binary representation of the message digest is returned.

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 PHP the function crypt() returns a hashed string. There are some constants that are used together with crypt() function. The value of there constants are set by PHP when installed. The constant [CRYPT_SHA-256] will output a SHA256 hash. There is no decrypt function. The crypt() function uses a one-way algorithm.

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 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.
More orphaned blocks: If a lot of miners are over mining they will come up with new blocks simultaneously. This will result in or more blocks not getting to be part of the main chain and becoming orphan blocks.
So, in order to restrict block creation, a specific difficulty level is set. Mining is like a game, you solve the puzzle and you get rewards. Setting difficulty makes that puzzle much harder to solve and hence more time-consuming. WRT bitcoins the difficulty target is a 64-character string (which is the same as a SHA-256 output) which begins with a bunch of zeroes. A number of zeroes increases as the difficulty level increases. The difficulty level changes after every 2016th block.

1 Like

Collisions in hash functions have nothing to do with block generation. A collision simply describes the probability of a hash function to return the same output for two different inputs. :slight_smile:

2 Likes