Question 1 - Explain what does the resistance to collision mean? And what does resistance to preimage mean?
Resistance to Collision is one of the terms when it comes to blockchain technology. Resistance to Collision in cryptography terms is the property of a hash function where two colliding inputs come out with the same output and with the same hash. When it comes to resistance to collision, there has to be cryptographic has function as well. Resistance to collision is basically when the hash function becomes difficult for two inputs hashing to the same output. With that said, there will be a collision each time a hash function has more input that it has more output. Hashing is basically the process where an input of varying length passes through a special algorithm to produce an output of a fixed length. In the world of blockchain technology, hashing are a key aspects many blockchain technologies. Simply put, resistance to collision occurs when inputs which are not the same produce the same output. Recently, the hash functions that many blockchain technology make use of are collision resistant so as to prevent two different inputs having the same hash output.
When it comes to resistance to collision, it is impossible for the hash gotten from an input to match another hash that is produced by another input. The SHA-2 (including SHA 224, SHA 256, SHA 384, SHA 512) are hash functions which are considered to be very efficient when it comes to resistance to collision so as to prevent different inputs from having the same output. In this case, whenever a hash function becomes resistance to collision or collision resistant, it is difficult to discover identical outputs which prevents confusion from the original has being unnecessarily swapped for the fake hash. The resistance to collision become very necessary when there is dependent on the hash functions to produce two inputs to two different outputs. As far as cryptographic has function is concerned, resistance to collision is a very important aspect so as to maintain the authenticity of both the inputs and outputs that are unique for the transaction.
Resistance to Preimage
Resistance to Preimage is yet another very important aspect of the hash function because of how difficult it is for attackers to discover which input matches the output hash, this is why the resistance to preimage is very powerful and a necessity as far as hash function is concerned. With this, no attacker can alter or manipulate the hash of any of the transactions simply because it is impossible to discover the input that of the hash output. Hence why the preimage is associated to one way functions. When it comes to securing the hash from attackers, the resistance to preimage in the hash function is very important because it helps secure the hash from bad actors who wants to alter or manipulate the hash.
This is a very powerful and important security property that is unique in its own way because any bad actor that aims to alter or manipulate the hash will find it very difficult and almost impossible to discover the matching input from the output. In the resistance to preimage, there is the first preimage resistance and second preimage resistance. The first preimage resistance is characterized as the one way function simply because it is impossible to invert it to generate the inputs that produced the output hash. This is beneficial because it improves the security of the stored data in the hash. Simply put, the input that produced the hash is irreversible. In the second preimage resistance, it is not possible for the output of another input to be the same to the first input. Simply put, it is not possible for a second input to produce identical has as the first input.
Question 2 - Use tronscan and etherscan to verify the hash of the last block and the hash of that transaction. Screenshot is required for checking.
To demonstrate this, I will be using both the tronscan and etherscan as they are two very similar blockchains with very similar explorers.
On Tronscan
To do this on the tronscan explorer, you have to first of all visit the correct tronscan explorer url which is https://tronscan.org. This can be done on any device of your choice.
After that, you will have to scroll down and look for the Blocks and Transactions section.
You will find the last block 31817473. This number will always be different depending on the time of checking as far as there are continuous transactions that take place.
Click on the block number in the blocks section to bring up the block information and details.
After that, we can see the information and details about the block on the page. The hash of the block is 0000000001e57f0153a8a7b95b808d376d23f6d928aa5514557f9d3fac62575f
After that, to verify the transaction, On that page, just scroll down and verify on the transaction section of the block. After that, the next page shows details and information about the transaction.
On Etherscan
To do this on the etherscan explorer, you have to first of all visit the correct etherscan explorer url which is https://etherscan.io. This can be done on any device of your choice. The process is quite similar to the one above as both explorers are very similar.
After that, you will have to scroll down and look for the Latest Blocks and Latest Transactions section.
You will find the latest block 12800434. This number will always be different depending on the time of checking as far as there are continuous transactions that take place on the blockchain.
Click on the block number in the latest blocks section to bring up the block information and details. To view the hash, click on the see more option.
After that, we can see the information and details about the block on the page. The hash of the block is 0xe090bfaa2c8cc1a4a3a1eec6177b3c83996319bf37df10973b0719e99473d274
After that, to verify the transaction, On that page and look for transactions. Click on the transactions to verify the transaction section on the block.
After that, the next page shows the transaction details and information. The hash on the lastest transaction is 0xfe521535b07a22e440a70e1a445db5e02645629f2cc1f298a610bcfdabe44876.
Question 3 - Generate the hash using SHA-256 , from the word CryptoAcademy and from cryptoacademy.
To generate hash using SHA-256, you have to first of all visit the url which is https://passwordsgenerator.net/sha256-hash-generator. This can be done on any device. The process is quite straight forward.
On the passwordsgenerator site, type in the word you want to generate hash for. To demonstrate this, I will be generating hash for the word CryptoAcademy.
After that, click on generate to generate the hash. The hash will be generated and we can see the result at the bottom.
From the result, we can see the generate hash for the word CryptoAcademy is D03CA34B258E6E0FD06B2070DDE61B50BD4EEF6161A8EDAA4A420C9AE1BEB7F9
Also, generating the hash for the word cryptoacademy. we will follow the same process to generate the hash.
From the result, we can see the generate hash for the word cryptoacademy is 0592F5DD27DC72E675B2AB9C77487A69FAAF84196597FA052EC099C18EE7C4C5
My Observation and Opinion
From my observation and opinion, both hashes are different and this is because of the of the subtle difference in the case of the letters which resulted in different inputs. The first word has an uppercase C and an uppercase A, while the second word is all lowercase, because of this, the inputs are different which produced different outputs. This proves the concept of resistance to collision because the two words are the same, but the inputs are different, hence producing different outputs.
Question 4 - In your own words explain the difference between hash and cryptography
In hash, keys are not needed to retrieve the stored information. While in cryptography, keys are needed to retrieve the stored data and information.
In Hash, it is used for the storage of information and data on the blockchain. While in cryptography, it provides secure communication against bad actors. This means that cryptography is used to hide information for secure communication.
In hash, the stored data cannot be retrieved, which is why it is one-way. While in cryptography, keys can be used to retrieved the stored data/
In hash, it is regarded to be more secure since the hash is one-way and cannot be reversed. While in cryptography, the encryption can be reversed.
In hash, no matter the input length, the output will always be a fixed length. While in cryptography, the lengthier the input, the lengthier the output as well.
Conclusion
In the world of blockchain technology, hashing are a key aspects many blockchain technologies. Hashing is basically the process where an input of varying length possess through a special algorithm to produce an output of a fixed length. Resistance to Collision is one of the terms when it comes to blockchain technology. Resistance to Collision in cryptography terms is the property of a hash function where two colliding inputs comes out with the same output and with the same hash. Resistance to Preimage is yet another very important aspect of the hash function because of how difficult it is for attackers to discover which input matches the output hash, this is why the resistance to preimage is very powerful and a necessity as far as hash function is concerned. These are all very important aspects of blockchain technology that ensures that data stored is secured and cannot be altered.