Homework on Hash Functions - Questions

  1. hash functions are a cryptographic representation of information
  2. hash functions are used to protect the network from changes that where not agreed upon by the clients, like hacking and double spending
  3. collision resistant is the ability to produce a different hash for different information without creating either a different has for the same information or the same has for different information
  1. Hash functions are like a digital fingerprint where you can have any input converted by the algorithm to create the hash. For the hash function to work it has to be complex enough for it to be practically impossible to trace back to the original data or input.
  2. In Bitcoin hash functions are used from the creation of your wallet to verifying transactions on the network and creating blocks for the blockchain.
  3. For a hash function to be collision resistant it means that it is very hard to find two inputs that will hash to the same output.
  • Describe hash functions with your own words

Input to output is one way function, always one way. Slightest variable will automatically change hash function. Hash function is consistent with identical 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 Chain holds the Blocks, which contain the previous hash rates in each 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).

Almost impossible to produce same hash rates with different input.

  1. A hash function is a type of function with these two special qualities: 1) A unique input produces a unique output, and 2) can only be used from input to output. It cannot go output to input. It cannot subtract; it can only add.

  2. In cryptocurrencies like bitcoin, hash functions are used to take a transaction as an output and run it through a function such as SHA-256.

  3. When we say that hash functions need to be collision resistant, we mean that it is infeasible to find two colliding inputs (two inputs that have the same output when both of them are hashed). The minimal requirement for a hash function to be collision resistant is for the length of its result to be 160 bits.

1-Describe hash functions with your own words

Hash functions are instructions or algorithms that receive an input and gets an unique output for that input. Furthermore, they are one way functions, you can not go from the output to the 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 bitcoin, the chain uses SHA256 for hashing the content and pointers of each block. Since a single change in one bit will alter the complete hash, the network would see if someone tries to corrupt it.

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

It means that is almost impossible (or very difficult) to find two inputs that generate the same output when used in that function.

Hash functions are the equations used to obtain the random (x) bit string of numbers that serves as the "fingerprint " for each block.
Hash functions are one way street. You.canott deduce the input from the output hash. Though you can verify authenticity.
HashF(x)=256bit hash

Hash functions are also used in the signature process before the document can be signed it must be hashed

Collision resistance.

Collision resistance refers to the degree of probability of two independent functions generating an identical output The lower the better.
Identical output?
Two seperate users same randomly generated key.
Collision rate is how well you defend against that.

  1. hash functions involve taking an input of any length and returning an output of a fixed length, and allows you to keep track of the outcome. This protects the message transmission and enhances security of the input data

  2. When it comes to bitcoin the hash function used is SHA-256 which means it has a fixed 256 bits length output which enables tracking of transactions and confirmation in processing data

  3. Collision resistant means that in hash functions, it is highly unlikely for 2 different inputs to produce the same output

1. Describe hash functions with your own words
Hash functions encrypt an input into a unique 64 characters output, creating a unique footprint.

2. How are hash functions used in cryptocurrencies like bitcoin?
Hash functions are 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?
It means that it’s hard to find two inputs that hash the same output.

  1. Describe hash functions with your own words

Hash functions are one directional algorithms whereby an input is compressed into an output of a fixed length.

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

In cryptocurrencies, hash functions are used to generate unique outputs using the transaction data as inputs.

Since Bitcoin uses SHA-256, a 64 character string output hash is generated. The new hash becomes a reference for the next transaction data block.

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

Collision happens when two distinct inputs give an identical output. When hash functions are collision resistant, it means that they do not give an identical output easily when two distinct inputs are used.

1- For any length of input put through a hashing algorithm, a fixed length output is given.

2- In cryptocurrencies, the transactions are taken as the input and runs through the hashing algorithm and outputs a fixed length.

3- Collision resistance in hash functions means that when there are 2 different input hashes this will always give 2 different output hashes. You can never have 2 inputs giving the same output

Hash functions are a set of unique combinations of alphanumeric letters created for any input which is at the moment not vulnerable to identify the input with the output. in other words, they are digital fingerprints.

Hash functions are used to hash transactions by mining, where the miners try to solve a hash to gain rewards.

It means that there should be not 2 different inputs getting identical outputs or at least take an astronomically long time to find.

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words.
    Hash functions are functions that go from input to output only (one way) and create a personal ID or fingerprint for each 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).
    •They can be used to take key phrase words and translate them into a hash to make the key phrase words more secure.

  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).
    • Simply put this means that (some inputs will hash to the same output) these are hard to find. Almost impossible.

  1. Hash functions are one-way functions meaning when you input information you will get an output but not viceversa, you cannot use the output to get the input. The output will be the fingerprint of the input you run through a hash function, even a slight change in the input can lead to a very different output.

  2. Hash functions are used in mining for example, where the hashed nonce in concatenation with the hashed data (transactions) and their result have to be less than the mining difficulty in order for the block to be mined and the miner receive the block reward. This take a lot of random guessing and computer power which give the network its security.

  3. It is one of the properties of cryptographic hash functions where it is hard for two different inputs to hash the same output. Thus, H(A) = H(B) but A does not equal to B

  1. Hash functions are unique codes that when given a number, or fingerprint, change according to the changes of the finger pint.
  2. In bitcoin, the transactions run through SHA256 and the output is a fixed length.
  3. A collision resistant hash function is two inputs that are hard to find but hash the same output. H(a) =H(b) and a does not equal b.
  1. Hash functions are generating a fixed output from a string of any length, like a fingerprint of that data.

  2. Every block contains the hash of the data inside the previous block. This means that if you change the data in block 1, the hash in block 2 will be completely different.

  3. It means that every input has a unique hash. A and B can’t have the same hash, which makes it collision resistant.

  1. Hash functions are mathematical operations that turn a unique data input into a unique output with fixed length (64 bits).
  2. In Bitcoin hash functions are used to hash a block of transactions. The hash of the block serves as fingerprint of the exact state of that block (which transactions it contains) making it impossible to hack it as the slightest change to the block will result in a different hash of that block and hence change the following blocks which contain the hash of the previous blocks, chaining the blocks together and making the system immutable.
  3. The probability of two different inputs giving the same output hash must be so low that there is literally no chance that there ever will be a collision of two identical hashes pointing to two different inputs. In the event of such a collision still happening, the chain splits in 2 with each of the two blocks forking away from the previous chain. The chain that holds the most computing work will be accepted as the true chain and the other forked chain will be dropped. As this takes some time to happen, it is a common understanding that real immutability is reached only after consecutive blocks.

A hash function generates a specific, fixed in lenght output (hash) to any input. The slightest difference in the input causes a totally different output.
Other than in usual functions, there is no way to determine the input by knowing the output, other than by guessing.

Hash functions are key to bitcoin. They are used very often. Every new transaction (unconfirmed) gets hashed through the SHA-256 algorithm. When a new block gets mined, the output of the previous block gets hashed together with the new transaction data outputs + additional data, if that output starts with a defined number of zeros.

Collision resistant does not mean that two different inputs do not give the same outputs, which would be impossible because the output is fixed in length. It means that collisions happen very unlikely.

  1. The domain of an n-bit hash function (according to the material provided in this course) is the set of all finite strings of letters or numbers or, essentially equivalently, the set of all finite strings of zeroes and ones, and the range of an n-bit hash function is the finite set of all strings of zeroes and ones of length n. Thus the domain is infinite and the range consists of 2^n elements. To each element in the domain the hash function then assigns one element in the range. In this sense, a hash function is simply a function in the ordinary sense of this word (in all mathematics).
  2. According to the material provided in this course, a blockchain consists of data blocks that in turn consist of a header and a body comprising a certain fixed number of data units (which in the case of a cryptocurrency each represent a cryptocurrency transaction). These data units (containing each a transaction) give rise to a Merkle tree. That is to say, they represent the leaves upon which the tree is built by way of hashing. At the lowest level of the tree there are the hashes that are produced from each of the leaves (i.e., from each transaction). So the hashes in this lowest layer of the tree’s nodes represent the endpoints of the tree’s branches and they also represent the transactions in encrypted form—they are, so to speak, the original digital finger prints of the currency transactions. Moreover as neighboring nodes are now combined via concatenation, the next layer of tree nodes is formed as each concatenation is used as input to the hash function and thereby encrypted (in new corresponding hash). Continuing in this fashion a tree is built the branches of which have a common point of origin in a single hash which may be referred to as the ‘root-hash’ or ‘Merkle-tree root’. This root-hash effectively represents all the data units (or transactions) that compose a block’s body, and the total number of these data units is equal to the tree’s branches. Consequently, the number of layers in the Merkle tree is equal to the logarithm to the base 2 of the number of data units (or blocks) and it is this logarithmic reduction that is the reason (it seems to me) why the Merkle tree is a natural and highly efficient encryption tool. Furthermore, as the root-hash is now copied into the block header, as one of the header’s standard components, and the hash of the header of the previous block in the blockchain is placed in that same header, as another standard component, the blocks that forms the blockchain are effectively linked to each other by way of hashing. That is to say, if one transaction in one block is fraudulently altered by a hacker, then, in order, to provide the resulting corrupted chain with a false appearance of authenticity (in the searching ‘computer eyes’ of the other nodes or miners in the network), all the header-representing hashes in all the block headers that follow the corrupted block (with the one corrupted transaction) must be altered as follows: first the root-hash of the Merkle tree with the one corrupted leaf must be recomputed, then the hash of the header with this altered root-hash must be recomputed, and then the hash of the next header in which this original altered header needs to be placed must also be recomputed and so forth all the way up to the first block in the chain. (There may be more involved as far as proof of work is concerned, but this is about as much as I could extract from the materials provided in this course as far as the use of hashing in cryptocurrencies is concerned.)
  3. According to the materials provided in this course (it seems to me) a hash function is said to be collision resistant if the probability of finding two input strings that produce the same output hash is exceedingly small. The two principal hash-function properties by means of which this reduction in probability to a very small value is achieved are 1) the enormous size of the range of the hash function (2^256 elements in the case of the bitcoin hash) and 2) the essential discontinuity of the outputs of the hashing algorithm (small changes in the input produce large changes in the output). Moreover, according to the formula that explains the birthday-paradox, there is a 50% chance of a collision to occur if the number of distinct input strings is equal to the square root of the number of possible hashes (2^128 in the case of the SHA-256 used for bitcoin).
  1. Hash functions seek to take an input and turn it into a a series of random letters and numbers a.k.a a “hash”.

  2. Hash functions are used mainly in generation consensus and solving mathematical equations in order to “mine” bitcoin.

  3. There is a low chance of two different inputs having less chance of getting the same output.

  1. A hash function is a mathematical function that converts a numerical input value into another compressed numerical value. The input to the hash function is of arbitrary length but output is always of fixed length. Values returned by a hash function are called message digest or simply hash values.
  2. In the context of cryptocurrencies like bitcoin, the transactions are taken as input and run through a hashing algorithm ( bitcoin uses SHA-256) which gives an output of a fixed length.So basically, instead of remembering the input data which could be huge, you can just remember the hash and keep track.
  3. 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. Every hash function with more inputs than outputs will necessarily have collisions.