Homework on Hash Functions - Questions

  1. Describe hash functions with your own words
    -> A function that takes a set of inputs of any size and fits them into a table or data structure that contains fixed-size elements.

  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).
    -> Hashing is used to validate the integrity of the content by detecting all modifications and thereafter changes to a hash output thus in bitcoin as a use case we would insure that each coin generated in the chain is indeed unique and subsequently verified based on its encrypted signature

  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).
    -> We mean that we need to make sure that two different inputs should not hash to the same output .

1 Like
  1. A hash function takes data of any form and size and converts it to an alphanumeric string of a certain size.
  2. Hash functions are used to secure the network. A block can’t be added until a hash has been successfully verified. Because this is a difficult thing to do, miners reach a consensus on which is the correct block.
  3. Hash functions need to have only one output for one input.
  • Describe hash functions with your own words
  1. Hash functions are routines that take an input and calculate an output. If the original input changes the output would change as well.
  • 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).
  1. Bitcoin uses hash functions to do 3 things.
    a) Tie the blocks together on the chain.
    b) To produce a public address (wallet address)
    c) generate a private key to authorize transactions.
  • 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. Collision resistant means it is extremely unlikely that 2 different inputs would have the same output.
  1. Hash functions convert a unique alpha-numeric data to a unique digital fingerprint.

  2. Bitcoin uses Hash functions to connect blocks in a blockchain.

  3. (hash collision) is when two pieces of data in a hash table share the same hash value

  1. Simply put, hash functions are a way to take any data input and encrypt it, rendering it unrecognizable. The original data (message) is taken and transformed into an output - a hexadecimal number of standard length that bears no resemblance to the original information.

  2. Hash functions in Bitcoin and other cryptocurrencies serve various purposes related to security, such as block-creation.

The Bitcoin network is sustained by miner participation and competition. In order to mine the next block of information in the chain and reap the block reward, miners compete to solve a complex mathematical problem. Each miner uses the SHA-256 algorithm to discover the correct hash value that meets the conditions set by the network. It is like a blazingly fast guessing game made possible by hash functions and robust computational power. When the correct hash is discovered and the successful miner wins the block reward, the next block is created thereby securing the network.

  1. Collision resistance refers to the near impossibility that two different inputs generate the same hash output.

A hash function is any algorithm that maps data of an arbitrary length to data of a fixed length.

The SHA256 hash algorithm is used in the Bitcoin protocol to generate a verifiably “random” alphanumeric set of numbers using a base 16 language model in a way that requires a predictable amount of CPU effort. Generating a SHA256 hash with a value less than the current target, solves that block and wins you some Bitcoin.

Collision Resistant: a hash function is considered collision resistant when it is hard to find two inputs that hash to the same output.

1 Like
  1. A hash function produces a unique output for every input. It is also impossible (at least if the hash algoritm has not been hacked) to find the input given the output.
  2. Every bitcoin block contains a hash of the previous block. Hence any participant in the network can verify that the blockchain has not been modified by verifying the hash of each block.
  3. Two different inputs may never produce the same output to be “collision resistant”.
  1. Describe hash functions with your own words - Hash functions are Mathematical algorithms which takes certain input and produce a fixed size output. The output is normally an alphanumeric data, normally called string or byte. Hash functions are always deterministic which means same input will always have the same output. It is also fixed length which means even if an input is a string or a book, the output would always be of same length. We cannot rollback generated hash value (output of hash function) to its original value. Two different input value cannot have same hash value, however there can be some instances where two inputs might have same hash, this is called “Collison”.
  2. Hashing plays very crucial role in Bitcoin cryptocurrency.
    i. Mining and Proof of Work – Mining is a process to repeatedly running hash algorithm on certain input value (Transactions) and find a hash value which matches the difficult level with certain number of leading zeroes. The algorithm used in Bitcoin is SHA256.
    ii. Creation of a Blockchain – Every Block in a blockchain is created with hashed value of previous block, this creates a blockchain. So hashing plays a crucial role here as well.
    iii. Creating wallet – User’s public key is hashed to create user’s wallet address.

What does it mean when we say that hash functions need to be collision resistant? - Every Hash function generates a unique output for every inout. However, there can be instances where hash function generates same output for two different inputs. This is called “Collision”. A Hash function should always be collision resistance so that it always generates a unique hash value for each input. This is very important for security sensitive applications like Blockchain, digital signature generation, password storage etc. otherwise it would lead to vulnerabilities.

  1. Hash functions are functions that use input and turn them into 256 bits irreversible unique output.
  2. Hash functions in cryptocurrencies like Bitcoin are used for securing transactions and creating a tamper-resistant record. They work by converting transaction data into a fixed-size hash, a unique string of characters, ensuring both security and integrity of the transaction history.
  3. Collision resistance in hash functions means that it is extremely difficult to find two different inputs that produce the same hash output. This property is crucial in maintaining the integrity and security of data, such as in cryptographic applications like digital signatures and blockchain technology.

Typical hash functions take inputs of variable lengths to return outputs of a fixed length. A cryptographic hash function combines the message-passing capabilities of hash functions with security properties. Hash functions are algorithms that determine how information is encrypted. For example, Secure Hashing Algorithm 256 (SHA-256) goes through a process to encrypt the input it receives by:Converting it to binary, Creating hash values, Initializing constants, Chunking data into bits, Creating a message schedule, Running a compression loop, Modifying the final values

Collision resistant/free means that no two different input hashes should map to the same output hash.

  1. Hash functions are functions that produce unique fingerprints as output and it’s impossible to calculate the original input just by knowing the output.
  2. Hash functions are used to ensure that the information in the blocks on a blockchain is not altered.
  3. Hash functions need to be collision resistant so it should not be possible that 2 different inputs can produce the same hash value as output.
  1. Describe hash functions with your own words
    a hash function is a function that takes an input and gives an ouput, but that cannot be trivialy reversed. from the output I cannot know the input
    it takes a fixed base and “translates” the input into that base. the slightest change in input will change the output drastically

  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).
    the hash function is used to secure the transactions. every new block to be mined a certain number of zeros in front of the hash is set randomly by the protocole, taking into account difficulty and past performance of the network. the miners all try to guess the hash based on that number of zeros. those hashes also lock the blocks on the blockchain by linking them together

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).
collision resistance for a hash function is the fact that you have two different inputs that can produce the same output

  1. Hash Functions are those which transform inputs into a totally unrecognizable output. Even minor changes in input drastically changes the output string. The inputs cannot be deduced from Outputs
  2. In Cryptocurrencies hash functions are used to encrypt blockchain entries so that the block remains secure with the owner
  3. Collision resistant Hash functions are ones where no 2 inputs can result in same output.
  1. Hash functions are unique inputs, which give unique outputs.

  2. Hash functions are used in mining, creating keys (public/private)

  3. Collision resistant means 2 different inputs will never produce the same output

  1. Hash functions are a numeric code that shows the output of a transaction on the blockchain, presented in SHA 256.

  2. Hash functions are used as unique fingerprints for each transaction or for mining. Each function is unique and one-way.

  3. Hash functions need to be unique, there can never be the same function/hash.

  1. Describe hash functions with your own words
    It is like a math equation that only works one way. You can do the math addition but yuo can not undo it with subtraction.

  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).
    They are used to record the data onto the block. It is what makes the data unchangable.

  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).
    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 a ≠ b but H(a) = H(b).

  1. Input then Output, no way to go back. It is a unique fingerprint

  2. It is use to incript the transaction in a way that there’s no way to come back

  3. it means that their no way to find 2 input that got the same output

  1. Describe hash functions with your own words
    -Hash function is one way stream.
    -Each unique input gives you 1 unique output
    -Cant be worked backwards from output to input

  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).
    -Each block in the blockchain contains a hash of the previous block, linking them together.
    -Each transaction is hashed, creating a unique identifier.
    -Miners use hash functions to solve complex puzzles.

  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).
    -Different Inputs: It’s very hard for two different inputs to have the same hash.
    -Security: This prevents confusion and ensures data integrity.

1 Like
  1. Describe hash functions with your own words

Hash functions are special functions and are unidirectional. You can derive if an output is from an input but not if an input is from an output. If something in inserted or changed from the original then the hash will not match. This is because you get a unique fingerprint. Inputs can be converted into digital-bits of binary 0’s & 1’s which, when parsed through a hashing algorithm such as SHA256, outputs a digital fingerprint derived from the original inputs.

  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 uses a Secure Hash Algorithm(SHA), created by the National Security Agency as SHA-256 bit alpha-numeric code, in the networks proof-of-work(PoW) function. The (SHA-256) algorithm is in Hexidecimal or Base 16 i.e.) 0123456789abcdef format. Digital-fingerprints can be used to verify the data integrity of the output compared to the original input it is supposed to match. Miners compete to come up with these hash[s].

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

Hash functions need to be collision-resistant such that the harder it is to find two inputs that hash to the same output, the more secure the cryptographic hash function is. Less secure older hash functions such as MD5 or SHA-1 proved flawed. They broke when it was it was discovered that an easier & more efficient method than brute force could be used to find collisions.

  1. Describe hash functions with your own words
    A hash function is a function that is unidirectional (input to output) and each input will have a unique output.

  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 used in cryptocurrencies for integrity and security. They are used for mining (proof of work), transaction integrity, blockchain integrity, and address generation.

  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 added this question intentionally to make you research information on your own, that’s how you learn best).
    Collision resistance ensures that two distinct inputs cannot produce the same output. This is done through a large output space so that the probability of randomly finding two inputs with the same hash is extremely low.