sha256 hashes have 256bits (32bytes) or 64 Hexadecimal Digits
a collision is not an attack. It’s just because hashes make a fingerprint of any size of data to a fixxed size output. so there is always a chance that 2 different inputs could produce the same hash. the larger the output size of the hash is, the less likely you could find a collision.
sha256 hashes are 256 bits long. Thats 2^256 different possibilities.
-
Hash Functions will generate a value or values from a text using math functions. A formula generates the hash which will help to protect the security of the transmission (message) against malice; hacks;
-
Hash functions are part of the block hashing algorithm which is used to write new transactions into the blockchain through the mining process.
-
When its hard (“impossible”) to find 2 inputs that hash the same output.
(1) Each unique input gives a unique output. You only can go from input to output but never from output to input.
(2) Hash functions in bitcoin are used in mining for new transactions. Transaction data is hashed.
(3) It means there is no way that two different things get the same hash.
-
Hash Functions take an input and produce a unique output with a determined number of digits. It is not possible to start with the output and attain the original input. If any part of the input in changed the entire output is different.
-
Miners attain blocks to randomly apply functions and establish the correct chain of blocks to apply it to. Once a block has been solved and added to the chain the miner is rewarded.
-
It is possible for miners to establish a block solution for the same chain, in which case the blocks will “collide” and not be viable.
1: input of any size is being converted into a code of always the same size.a change of a single digit of the input completely changes the output(hash).it is infeasible to go from output back to input.
2: Hash functions are used to encrypt transactions and are used mining. Hash functions are needed to create new blocks.
3:Given two different inputs A and B where H(A) and H(B) are their respective hashes, it is infeasible for H(A) to be equal to H(B). What that means is that for the most part, each input will have its own unique hash.
- Describe hash functions with your own words
Hash Function - Each unique input makes a unique output with a hash function. Because of this you can never go from output to input with a hash function.
- How are hash functions used in cryptocurrencies like bitcoin?
With the bitcoin protocol the hash function is mainly used to write new unconfirmed transactions to the blockchain. Miners try to combine all the inputs (transaction data, time stamp and previous block reference) to get an output which starts with 18 zeros. This is known as solving a block with proof of work.
Cryptocurrencies also use hash functions as security, as a quick way to identify content (passwords, transactions,data) without revealing anything about the content.
- What does it mean when we say hash functions need to be collision resistant?
Collision resistance means that it is very unlikely for two inputs to produce the same output.
- A hash function will turn message into a string of numbers and digits of set length.
- Mining uses SHA-256 as the proof of work algorithm.
- Collision resistant means that the function must be designed in a way that it would be extremely difficult for us as humans with our current computing power to find another message(input) that creates the exact same output. In reality though, there are an infinite amount of messages(inputs) that would create the exact same hash output, the difficulty level to do this however, is astronomical at this current time.
> 1. Describe hash functions with your own words
Hash functions are mathematical formulas that take a string and output a unique result for each potential input. No two different inputs would likely ever produce the same hash. This makes hashes fantastic for positively identifying/labeling a piece of data as well as being able to see if the string used to produce the hash has been modified in any way (if it has modified it should produce a different hash when ran through the same function).
> 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 to produce unique transaction IDs for every…well, transaction that occurs on a given blockchain. These hashes can (typically) be viewed through a blockchain explorer which will typically show the public address of the sender, how much of coin/token A was transacted, the public address of the receiver, as well as a timestamp and the fee paid to send the transaction. Different blockchains will display different amounts/types of data–some coins, like Monero, are used specifically to obfuscate transactional information. I believe ZCash has already been cracked but as of now the US Government still has a bounty out for anyone who can crack Monero’s code to help aid law enforcement with their crypto forensics practices.
> 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 have a hashing algorithm that produces a unique result for inputs A and B given hashes h(A) and h(B). It’s like the DNA of a string of data, each string will have its own special lil hash result. Given that cryptocurrencies like Bitcoin use hashing algorithms like SHA-256 it’ll be another 20 bajillion years before we ever run out of unique hashes for our transactional data. And yes, I counted. It’s closer to 19 bajillion but 20 bajillion has more pizzazz
- Describe hash functions with your own words
A hash function is any function that can be used to map data of arbitrary size to fixed-size values.
The outcome/output will be a numeric or alphanumeric hash which is like an individual fingerprint and makes the system very secure. A good hash function should be fast to compute and is avoiding duplicate outputs from different inputs (collision resistant).
- 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).
HF are creating hashes, which are used to track transactions which will be stored on a block through minting. As the output of the HF cannot relate back to the input, it is making the usage of the product generated through HF’s very secure (such as Bitcoin).
- 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).
With this is meant, that any input has its own unique hash. However, within a fraction of hashes it might occur, that two different inputs could have the same output. Even though it is not supposed to happen, it might happen. Due to this the hash function is collision resistant and not proof. As the possibility is so minimal that two different inputs will have the same output, it is accepted that it might happen.
-
Describe hash functions with your own words
A: Functions that cannot determine input from output. It can only determine output from input. -
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: It is what is used to secure the transaction. It’s the fingerprint for identifying the specific transaction. -
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: Collision resistant means that two different inputs should not ever have the same output.
-
Hash functions digest an input string and creates a unique output string that represents a finger print of the data. The exact same input string will yield the exact same output(hash) string every time. How ever, if you change even the slightest insignificant thing on the input string the hash will yield a much, much different output string. Due to functions used inside Sha-256 at the binary level (like choice and majority) make it so this function can not be reverse engineered to yield the original input string from the hash string. It is truly a one way street.The purpose of the hash is to validate nothing in the original input string was altered.
-
Data input is hashed, both the Data and Hash are recorded into blocks. The hash in the block can validate that the data has not been altered. The block is then hashed and that hash is placed in the next block created along with new data and its hash. This hash from the previous block will validate that the previous block is intact and has not been altered. This process repeats its self so that every new block validates the block before it. This prevents someone from altering a block of data that has already been created and agreed upon.
-
A collision is the chance of two dissimilar input strings creating the exact same hash value. Having two different input strings yielding the exact same hash value is undesirable for several reasons. The SHA-256 Hash function has several components that reduce the chance of a collision and is considered to be Collision Resistant. Older, smaller and less complicated Hash functions like MD4 and such were not as Collision Resistant.
Homework on Hash Functions - Questions
-
Describe hash functions with your own words
A function that takes an input (Data Set) and produces a unique output -
How are hash functions used in cryptocurrencies like bitcoin?
Hash functions are used in the mining process to add new blocks to the chain. -
What does it mean when we say that hash functions need to be collision resistant?
A collision is when the output of the hash is identical to another output already in use.
- Describe hash functions with your own words
Ans: A function that takes any input and converts it into a set amount of output that is unique to each input. - 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).
Ans: In Bitcoin, the Hash function is used to hash transaction data. Mining involves finding a nonce and that requires finding a number that generates a specified hash in combination with data unique to that block. - 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).
Ans: Collision resistant means that there are no two inputs that result in the same output in a hash function.
Homework on Hash Functions - Questions
- Describe hash functions with your own words.
A way of mathematically calculating a fixed value for an output in such a way that a given input of varying size can’t be determined from the output.
- 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).
Used with merkle trees (hashing) and linked pointers (pointers to data which in the case of BTC also contain a hash) they create the blockchain which is the core of bitcoin.
- 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 means that if you hash two different inputs, they should never result in the same output. Without collision resistance, we’d have no Bitcoin.
1.) One way function that tranform text or numbers in binaery data. every Hash is unique and when i change a single letter, space or number THE HASH WILL BE TOTALLY DIFFERENT!
2.)the Hash function SHA-256 in bitcoin is used to produce Hashes of data. The current Block has the Hashes from the previous block and the next Block from the current Block. Thats produce a connected Chain which every change in one the Blocks changed the folloing blocks! Therefore its a very secure way to build Chains of connected Block where all changes effects the other block and that means that manipulation is nearly infeasible!
3.) Two different Inputs produce totally different outputs! If you change one single Input the Hash will be totally different! It can happen BUT with the SHA-256 algorithm it is nearly infeasable! And you can only go from Input to Output! Not in the other way!
- Hash function in an unique input that gives an unique output.
- In cryptocurrencies like bitcoin, the transactions are used as an input and though the 256 hash function the miner lock the transaction to the blockchain.
- It means that two different input cannot generate two equal output.
-
Has functions creates a unique fixed-length output from a variable length input.
-
The has function outputs a fixed length number (fingerprint) that can be referenced in the chain to validate (the previous block? next block?). It also protects against using the hash output to discover the input.
-
It must be very improbable that to different inputs result in the same hash output. If there are more inputs than outputs - collisions will occur.
- hash functions take an input and gives it a unique output (fingerprint). It is not able to be done in reverse thus keeping the input data secure.
- transactions like sending bitcoin generate a hash (fingerprint) that can be seen by all and verified, but cannot be reverse engineered to see input. That keeps the sender secure and the transaction from being manipulated.
- It means that 2 different inputs having the same hashes is infeasible
-
Hash functions are algorithm’s that take an arbitrary input of data and return a fixed sized hash value. This function should only work on an input to output basis never the other way around.
-
Bitcoin uses the SHA 256 algorithm the input for the this algorithm come in the form of transactions that are yet to be confirmed. Once the transactions are confirmed using proof of work they are assigned a hash value which is then added to the blockchain.
-
Hash functions that have more potential inputs than outputs will potentially have collisions. This is a situation where the output ‘hash values’ are the same. The pigeonhole principle means that any hash function with more inputs than outputs will necessarily have such collisions, the harder they are to find, the more cryptographically secure the hash function is.