Homework on Hash Functions - Questions

This is not what collision resistance means. Collision resistance explains the probability of two inputs resulting in the same output. :slight_smile:

  1. Describe hash functions with your own words

Hash functions are one direction function, for each imput there is a unique output (digital fingerprint).

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

Bitcoin’s blockchain uses these important hash algorithm characteristics to run its consensus mechanism (SHA-256). It is used to hash transactions in each block, as each transaction has a unique output (digital finger print). This is how blockchain security is achieved.

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

It is impossible for two imputs to have same output. For each imput there is a unique output.

1 Like
  1. Hash functions are random integers assigned to the blockchain to stamp it and encode it.
  2. Hash functions are used to generate the next transaction and to validate the chain of previous transactions upon which the new one is built, thereby constructing an intricate encryption that cannot be hacked.
  3. Collision Resistant means that the output is cryptographically unique so that: a) the input cannot be determined from the output; and b) no two inputs will have the same output.
1 Like
  1. A hash function is a unique input that gives a unique output ā€œdigital fingerprintā€. These inputs are only one way functions that can not be reversed.

  2. Hash functions are used in crypto currencies, like bitcoin, to write new transactions into the blockchain through the mining process. These produce digital finger prints that can not be duplicated or reversed in the ā€œblockā€. If someone wanted to change a number or letter to create a double transactions they would have to change all hash functions in the block. In this way crypto currencies ensures the integrity and security of the data.

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

1 Like

LOL! Thanks - Should I repost to the right one?

Its fine, I’ll let you pass…this time :wink:

1 Like

[quote=ā€œivan, post:1, topic:8430, full:trueā€]
Homework on Hash Functions - Questions

1. Describe hash functions with your own words

    -Hash Function One Way Function, NO Reverse
    -Unique input unique output
    -Digital Fingerprints
    -Secure Hash Algorithm SHA-256 used by Blockchain

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).
-SHA-256, Secure Hash Algorithm,
-SHA-256 generates an almost-unique 256 -bit (32-byte) signature for a text.
A hash is not ā€˜encryption’ – it cannot be decrypted back to the original text (it is a ā€˜one-way’ cryptographic function, and is a fixed size for any size of source text).
**—>**Quickly running through the validation process in the Bitcoin network again, a block is bundled and contains several transactions as well as information on the previous block. This means if someone wanted to change the ledger or double-spend a transaction, he or she would have to change the hash in all previous blocks.
In order for the bundled block to be added to the blockchain, miners need to find a hash that meets the target difficulty. Each block contains a blockheader with the number of the block, the hash of the previous block and a ā€œnonceā€, which includes a timestamp. The purpose of a nonce is varying the input to a cryptographic hash function, that is increased randomness, in computation during the mining process. :nerd_face:

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).
[/quote]

Security Property 3: Collision Resistance

A collision happens when an attacker can find two inputs x1 and x2 that both map to the same output. … Collision resistance is important when you’re relying on hash functions to always map two inputs to two different values, like in the content-addressable storage example above.

:alien: :alien:

2 Likes

I mean if there is for example two input sources and only one output result, then it is false and cannot be verified. Source and result amounts equals. Does this make any sense?

  1. Describe hash functions with your own words

A hash is a translator that can receive any form or size of data, including digits, letters, or media files, and translates them into an alphanumeric string of a certain size. The size varies depending on the hash function in use. Some sizes include 64-bit, 128-bit, and 256-bit.

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

Hashing keeps Bitcoin secure by encrypting transaction data through hash SHA-256. The BTC transaction data is secure by adding new hashed blocks to the blockchain.

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

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

1 Like

Blunder Woman here. Now i hit the ā€œreminder flagā€ and put a reminder on your reply. Geesh. Don’t leave me! i may fall and not be able to get up :slight_smile:

1 Like
  1. Hash functions are unidirectional computations of an input into a unique output. In other words, it takes an input and produces an output, but you cannot take that output to solve for the input. Changing a single character from the input will give you a completely different output.
  2. Hash functions are used in bitcoin to create blockchains. Miners compete to essentially solve the hash. Once the hash is solved, it creates a block and this process is repeated to create a chain of blocks–each block containing the previous block’s hash. This prevents hackers from manipulating a block because it is open to viewing for all and once something is changed, everyone can see it.
  3. Hash functions need to be collision resistant meaning it is nearly impossible for 2 inputs to provide the same hash.
1 Like

1.- It is a function that receives an imput and returns an output. But for every small change in the imput, the output suffer a complete change. In addition, it is impossible to know the imput from the output

2.- For generate you private keys. And for unify all transactions in a block into a single output

3.- That is impossible to generate de same output with different imput

1 Like
  1. Hash functions are one-way functions used to create a unique output.
  2. Hash functions in cryptocurrencies are used to label private and public keys. It allows digital information to be accessed by the owner of the private key only while still being tracked on the public ledger. Combining security and transparency. (not sure on this answer and how miners are interacting with hash functions exactly)
  3. I believe collision-resistant is referring to hash functions that are not easily retraced/solved. Like the old hash function, MD5 would no longer be considered collision-resistant because it is no longer unidirectional. OR maybe collision-resistant means hash functions where it is hard/impossible for different inputs to hash to the same output.
1 Like
  1. Describe hash functions with your own words - hash function is any function that can be used to map data of random sizes to a fixed size value.
  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 are part of the block hashing algorithm used to write new transactions into the blockchain through 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 two inputs do not hash to the same output.
1 Like

Hash functions take input/data and algorithmically encrypt the data in a one-way, irreversible process.
Bitcoin uses the proof of work block hashing algorithm called hashcash. The hashcash algorithm takes the following input that is with in the header:
A. service string- encoded in the block header data structure and includes:
1. a version field- block version number
2. the 256-bit hash of the previous block
3. The root hash of the Merkle tree of all the transactions in the block.
4. Time- current block timestamp as seconds since 1970-01-01T00:00 UTC
5. Difficulty
B. Nonce (Number Only used oNCE). Nonce is an arbitrary 32-bit number that is part of the hashcash algorithm (also part of other hashing algorithms). Nonces are generated using larger length random number generation to minimize collision attack.
Nonce is the number that blockchain miners are solving for.
The process of guessing the hash starts in the block header. It
contains the block version number, a timestamp, the hash used in the
previous block, the hash of the Merkle Root, the nonce, and the target hash
C. counter- the counter parameter is small at 32-bits. So, each time it wraps the extra-nonce field, it must be incremented (or otherwise changed to avoid repeating work) .

When mining bitcoin the hascash algorithm repeatedly hashes the block header while incrementing the counter and extra-nonce fields. Incrementing the extraNonce field involves recomputing the Merkle tree, as the coinbase transaction (genesis block)is the left most leaf node.

The body of the block contains the transactions. These are hashed only indirectly through the Merkle root. Because hashes are not hashed directly, hashing a block with 1 transaction takes exactly the same amount of effort as hashing a block with 10,000 transactions.

Collision resistance means that is it highly unlikely (although not impossible) that the hash function of two separate variables will produce the same result.

1 Like
  1. Hash function is an input that sends information like a digital fingerprint which becomes an output making the information secure with letters and numbers.

  2. bitcoin uses hash function through mining.

  3. Making it impossible for someone to retrieve the input of the hash.

1 Like
  1. one way computations that produce a deterministic output
  2. the miner who produces a hash with enough leading zeros wins the block and the rewards
  3. collision resistance refers to being hard to find dissimilar inputs resulting in the same output
1 Like

I’m not sure what you mean by that. If the input corresponds with an output then you can be fairly certain that its valid. There hasn’t been any collision found in SHA256 for now at least.

SHA is not used for PK cryptography. Private key is just a random number and to derive public keys the Elliptic curve function is used. The public key is hashed to get the address. :slight_smile:

I think hashcash is the PoW algorythm. The hashing algorithm (used in PoW) particularly is called SHA256. :slight_smile: