Homework on Hash Functions - Questions

1. Describe hash functions with your own words
A: The has function is universal translator that takes inputs and puts them in an alpha numeric string so that the inputs cannot be identified.
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).
A: BTC uses the SHA256 algorithm to produce hashes. The hashes are combined into blocks and once verified by the network in a block it cannot be changed.
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: It is possible that 2 inputs can have the same hash. When this happens it is a ā€œcollisionā€. A successful cryptographic hash is resistant to this occurance.

1 Like

Well done your post helped me understand this concept better. KEEP it coming , us newbies need all the help we can get. Cheers!

  1. As I’m learning the 5 w’s of hashing I believe it’s a function that converts an input of numbers and letters into a encrypted output digitally.
  2. Secure Hash Algorithm - 256 bit is used in cryptography as a typical hash function that takes some input of arbitrary size, and produces a result of some fixed size. If you give it the same input, it always, always produces the same output.
  3. Hash functions come in three more or less distinct varieties. One is a hash function for a hash table. We want to take some key, and hash it to get a position in the hash table where we’d store data with that key. In this case, the primary emphasis is on speed—we want to be able to store and retrieve data quickly, and we have to has the key to store/retrieve the data, so we want to hash as quickly as possible. For this purpose, we typically use a very simple hash function—often as simple as adding one byte of key at a time to the existing hash, rotate the hash value some amount, and repeat until we’ve hashed the whole key.

The second common type of hash is something like a CRC. This is typically used for things like giving a reasonable degree of assurance that data you’ve transmitted arrives intact. For example, when you send data via TCP, the TCP stack does a CRC on the data, and sends that CRC along with the data. The receiver re-computes the CRC on the data it receives, and compares it to the CRC that was sent. If they don’t match, it asks for the sender to re-send that packet, because something was corrupted in the transmission. Here we’re typically willing to spend somewhat more effort on the hash function to get a better assurance that the result is intact. Given a specific amount of data and size of CRC, we can compute specific probabilities, so we have a 100% chance of catching any single-bit error in the data, 99% chance of a two-bit error, etc.

The third class of hash functions are cryptographic hashes. One intent of a cryptographic hash (that’s different from the previous two) is that we want to make it as hard as possible to find a relationship between the input and the output. For example, with a hash function for a hash table, if I have one string that gives a hash of 1234, it’s typically pretty easy for me to find another string that will also give a hash of 1234. In hashing, that’s called a collision. It’s also typically fairly easy for me to design a string to produce a specified value of hash, of any of a number of specified values that fit some particular pattern. With a cryptographic hash, what I want to make both of those as difficult as possible

1 Like
  1. Hash functions are a type of cryptography that can be used to verify the integrity of an input without having to check the entire data set.
  2. Each block in the chain, which contains data for instance about the BTC you bought, is added to the other blocks and changes the final output. It means you cannot change anything on the chain because it will change all the outputs of the blocks after that and it needs to be hashed again in order to be confirmed.
  3. It means that it is hard to find two inputs which produce the same output.
1 Like
  1. A hash function is a function that will take an input of any type and turn it into a unique output number which is considered the unique fingerprint of that input.

  2. Hash functions are used in cryptos like BTC by taking in the most recent unverified transactions and coordinating information on them. Once they receive that information in a block they will work to figure out a hash that is less than the target set by the other miners. Once that has is achieved the info will be saved to the blockchain as a ledger of the transactions and past transactions. This is seeming to be a pretty tough topic so I hope I’m somewhat getting this concept. :laughing:

  3. Hash functions being collision resistant means that when different inputs are put into them that the function will never produce the same hash output.

1 Like
  1. A hash function converts a string of data to a fixed lenght output. Hash functions are not possible to reverse and works as a digital fingerprint to your data.

  2. They are used to verify and secure transactions so that only the intended recipient can access transactions.

  3. Hash functions must be collision resistant to hinder an adversary who tries to decode and break the hash function by finding two inputs that produce the same output. If an adversary finds the way to decode a hash function then bitcoin would be broken.

1 Like

1. Describe hash functions with your own words

A hash function is a special function that takes any string of data, text or numerical and returns a unique, unchangeable fingerprint, unique only to that data or file.

Hash functions take data inputted and provide a fixed length output – resulting in an encrypted series of numbers and letters that do not resemble the original data.

Should any of the data be changed, the unique fingerprint would also change. Hash functions are repeatable – providing the input is always the same. SHA256 Hash functions are one-way functions, the input cannot be deduced from knowing the output, which has been possible with MD5 hash function.

󠀠

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

Blocks within the blockchain network contain the hashes of the previous blocks. Cryptocurrencies like Bitcoin use hash function SHA256, a one-way function.

Hash functions are part of the Bitcoin block hashing algorithm, this algorithm is used to write new transactions into the blockchain network through proof of work and mining.

󠀠

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

Collision resistant means a very low probability of two inputs generating the same output hash for different data. A hash function is collision resistant - meaning it is highly improbable two inputs will hash to the same output result.

Hash functions are special functions designed to be collision resistant, like hash function SHA256 for example.
󠀠

2 Likes
  1. Hash function means the algorithm of converting input data to some alphanumeric view.
  2. Mining of cryptocurrencies is based on hash functions. And mining is dedicated for keeping the blockchain ā€œaliveā€
  3. collision resistant meath that is hard to find 2 inputs with the same hash.
1 Like

It’s a one way function. Each unique input (like a digital fingerprint) will give a unique output. And reversed is never possible. You can not go from output to input.

Every input no matter what lenght is translated to an output of fixed lenght. In the SHA256 it meens in 256 digits. When you only add or erase one single digit in the input, the output will be totally different. This hash is almost impossible to read or crack.

When 2 different inputs have the same outcome as output, that’s called a collision. There is no collision free hash function, because there al in the same amount digits. But the chance of a collision is extremely small.

1 Like
  1. Describe hash functions with your own words
    Each unique input results in a unique output. It is a one-way function. No way to go 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). In the bitcoin protocol, hash functions are part of the block hashing algorithm. The block hashing algorithm 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 said to be ā€œcollision resistantā€ if it is hard to find two inputs that hash to the same output.

1 Like
  1. Hash function is a one way function that can take argument of any length and produce unique output of fixed length. Input at the moment can be theoretically brute forced but never derived from the output.

  2. Hash function is used to make a new block made of hashed verified transactions and in Proof of Work challenge.

3.It means that for different inputs hash function should produce unique hash in order to avoid problems.

1 Like
  1. Hash function is a one to one , one dirsction function.

  2. At first, Hash function is used as a mining process. Miners need to solve the hash algorithm which is based on the hash function to mine new block. Secondly, hash function can hash a transaction. It will make sure the security of the transaction.

  3. Collision resistant means that it“s very hard to find two inputs with the same output. can be used for the security of the corresponding cryptograph system of this hash function.

1 Like
  1. Hash function is a one way computation that take a unique input to a unique output.

  2. In numerous way but to make a high degree of difficulty to crack hash through the function SHA-256 for the blocks on the Bitcoin blockchain.

  3. The function needs to be complex enough that the chance of two input computations coming up with the same output is virtually impossible

1 Like
  1. Describe hash functions with your own words
    Hash functions are one way functions, meaning every unique input has an 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).
    In the bitcoin, hash functions are 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?
    Collision resistant simply means that each unique input only gives one unique output. Never two variables give the same output.

1 Like
  1. Has functions are one way functions, meaning they can not be reversed to calculate the initial input used to generate the hash. Only input to output

  2. They are used by miners to verify unverified transactions on the blockchain and also to keep input info secure

  3. No 2 inputs must ever come up with the same hash value

1 Like

Hash Functions - Questions

  1. Describe hash functions with your own words
    Love the food blender Idea, produce in, blended Pulp out.
    Hashing is one way to enable security during the process of message transmission when the
    message is intended for a particular recipient only. A formula generates the hash, which helps to
    protect the security of the transmission against tampering.

  2. How are hash functions used in cryptocurrencies like bitcoin?
    SHA-256, no matter how big or small your input is, the output will always have a fixed 256-bits length.
    This becomes critical when you are dealing with a huge amount of data and transactions. So basically, instead of remembering the input data which could be huge, you can just remember the hash and keep track.

  3. What does it mean when we say that hash functions need to be collision resistant?
    One of the six properties that a cryptographic hash function needs to have in order to be considered secure.

Since hash functions are deterministic, the hash of a particular input will always be the same, so you can simply compare the hashes and find out the original input.

The brute-force method basically means that you have to pick up a random input, hash it and then compare the output with the target hash and repeat until you find a match.

Average scenario: You will find it somewhere in the middle so basically after 2^128/2 = 2^127 times.
To put that into perspective, 2^127 = 1.7 X 10^38. In other words, it is a huge number.

This is where the Birthday Paradox comes to play.
This is another reason why Hashing is being done usin a function like SHA-256.

So, while it is possible to break pre-image resistance via the brute force method, it takes so long that it doesn’t matter.

1 Like
  1. Describe hash functions with your own words

From a given unlimited sized input, a hash function creates a defined unique output, if even the slightest bit is changed in the input, it would be a completely different output, making this a unique digital fingerprint of the original input data. You can only go from input to output, as there is no way to predict what the output will be from a given input, it is impossible to reverse

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

It Is the probably the most important mathematical operation in cryptocurrency, especially bitcoin, its needed for proof of work, and proof of work is the vital component in consensus, so basically all to do with miners , they package all their individual transactions that they have heard on the network then package all up , initiate a nonce, a nonsense number they then keep on changing the number with the objective to get a hash output starting with zeros, at the time of writing, in the bitcoin case its something like 17 zeros, forget doing that with your commodore 64 !

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

Collision resistance is a property of cryptographic hash functions, It should be really hard to find any two random inputs that hash to the same output hash, the harder they are to find, the more cryptographically secure the hash function is.

Cryptographic hash functions are usually designed to be collision resistant. However, many hash functions that were once thought to be collision resistant were later broken. MD5 and SHA-1 in particular both have published techniques more efficient than brute force for finding collisions. However, some hash functions have a proof that finding collisions is at least as difficult as some hard mathematical problem (such as integer factorization or discrete logarithm). Those functions are called provably secure.

2 Likes
  1. Describe hash functions with your own words.
    Hash Functions are one way functions, where unique input produces an unique output( unique fingerprint) that cant be reversed.

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 blockchain algo which is used to write new transactions into 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).
Hash functions need to be collision resistant so that two different inputs produce same output.

1 Like

1 - A hash function is a mathematical process that takes input data, performs an operation on the data, and returns a unique output. A hash function is unidirectional, in that the input cannot be derived from the output.

2 - Bitcoin uses hash functions in its block hashing algorithm to write new transactions into the blockchain via the mining process. The inputs into the hashing function include recent transactions, time stamp data, and reference to the previously verified block.

3 - Hash function collision resistance means that it is very hard (although not impossible) for different inputs to result in the same hash output.

1 Like

ah, so that’s what a nonce is! I’d heard about it. Now I know exactly what it is. Thx