Crypto Academy / Season 3 / Week 2- Homework Post for Professor @pelon53 - Topic: Hash and Cryptography

4개월 전

Man's need for a secured means of communication didn't start today. As Solomon rightly said, there is nothing new under the sun. If we decide to study the ways by which messages are been sent from the beginning of time till now, starting from message delivery through messengers, sealed letters, post offices and so on, we will find their several flaws, of which the worst of them was low security. For this reason, its not surprising why man have kept on seeking for a secured means of sending a message from one party to another successfully, without the message being interfered by a third party.

In our generation, it seems like we have finally achieved this long time goal. Through the discovery of the art of cryptograph, man have devised a means of setting up standard protocols that permits only the sender and receiver (both of who have a unique code) to be able to access the sent message. This code is totally secured, and it's believed that it will take millions of years for the best super computer to hack it.

There are basically two ways of securing data for transmission using cryptography, and they are Hash and Encryption. Although both do the same job of securing data, they differ in the method they do so. Nonetheless, among the two, hash seem to be more secured, and for that reason, it is used majorly in the world of Cryptocurrency.

meeting-1177454_640_1625750265181.jpg
Background:Pixabay

In today's lecture, professor @pelon53 while teaching on the topic "Hash and Cryptography" has shown us how hash works, it's irreversible nature and how it is used in creating private key and public keys. This post is my response to the assignment he gave after the class.

image

Question 1: EXPLAIN WHAT DOES THE RESISTANCE TO COLLISION MEAN? AND WHAT DOES RESISTANCE TO PREIMAGE MEAN?

RESISTANCE OF COLLISION

To explain resistance of collision, we must first understand what collision means. In cryptography, the word collision is used to describe a scenario when a certain hash function brings out the same exact output for two different input values. For instance, let say two different information where passed through a hash function and they both came out individually with the same output, if the reciever tries to access the message sent to him, what he may recieve on his end might be the wrong message, meaning that the message the sender sent is very unsecured.

Now, Resistance of collision is an important characteristics of a hash function which ensures that no two inputs passed through the hash function will come out with the same output. This ensures the security of an information encoded using the hash function.

Let's use an illustration so as to better understand this. The first hash function that was developed was called SHA-1, thus function had very limited output value, thus, after it exhausted the list of output value it can assign to an input or information, it began to assign the same output it has issued out to newer inputs. This compromised the hash function, and there was a need to create a new hash function that will solve this problem.

The name of the new hash function that was created is the SHA-256, and it has a strong resistance of collision. This means that the probability of this function to assign the same output value for two different inputs is very very low. It is this hash function that we are currently using now.

image
Resistance


RESISTANCE OF PREIMAGE

Resistance of preimage is one of the characteristics of a hash function which emphasises on the irreversible nature of the hash function. This characteristics ensures that the output value of the hash function cannot be used to generate back its input value.

This implies that the sequence of operation of a hash function only occurs in the forward direction, and once an input have been passed through a hash function, it can be Dr be gotten by through its output value.

Basically, there are two levels of resistance of preimage. The first is the Preimage resistance which ensures that the output value obtained through a hash function cannot be obtained using an input function. The second level called the second Preimage resistance makes sure that no second input will be able to generate an output exactly the same as the one obtained from the first input.

Both the resistance of collision and resistance of preimage can be found in the new hash function SHA-256.

image

Question 2: USE TRONSCAN AND ETHERSCAN TO VERIFY THE HASH OF THE LAST BLOCK AND THE HASH OF THAT TRANSACTION. (Screenshot Is Required).

One notable attribute of the blockchain is it's transparency. You can see the information of every single transaction carried out in the blockchain including the Hash, the wallet address, time of transaction and so on. To check the hash of the last block and the hash of that transaction follow the steps below:

TO VERIFY HASH FOR TRONSCAN

Hash of Block

Step 1:

Visit the Tronscan website by clicking on this link

Step 2:

When the home page comes up, scroll down to section with the heading Block | Transaction.

Screenshot_20210708-111415_1625750388075.jpg
Screenshot

In this section you will find the detail of every single transaction carried out in the blockchain. Since a transaction occurs in the blockchain every second, you will notice that the details of the transaction keeps changing all the time.

As of the time of checking, the last transaction was from a block with an ID (or height) number of 31755031. as shown in the screenshot above.

Step 3:

To know the details of the block such as the block hash, time e.t.c, Click on the block ID. When you do you will see all the informations of the block.

For instance, the block has a hash given as:
0000000001e48b172ec1d3b5361870e10748e7c56775cd7c80cc38d38397d14c as shown in the screenshot below

Screenshot_20210708-111822_1625750432450.jpg
Screenshot

Hash of Last Transaction

Step 4:

To find out the Hash of the last transaction carried out on that block, still on that page, scroll down to the section labeled "Transaction". As shown in the screenshot below.

Screenshot_20210708-112114_1625750472159.jpg
Screenshot

As of the time of this post, The last transaction on the block was 7 minutes ago.

Step 5:

Click on that transaction. When you do, a new page comes up, which contains the details of the transaction.

Among the details is the hash of transaction which is: 70deaecf448de158a8abdbb994099673c43d156c09f74519d731df48bd2cb0ac as shown in the screenshot below.

Screenshot_20210708-112659_1625750493432.jpg
Screenshot


TO VERIFY HASH FOR ETHERSCAN

Hash of Block

Step 1:

Visit the Etherscan website by clicking on this link

Step 2:

When the home page comes up, scroll down to section with the heading "Latest Blocks" as shown in the screenshot below.

Screenshot_20210708-143854.png
Screenshot

In this section you will find the detail of every recent transaction carried out in the blockchain. Since a transaction occurs in the blockchain every second, you will notice that the latest blocks keeps changing all the time.

As of the time of checking, the last transaction was from a block with an ID (or height) number of 12786226. as shown in the screenshot above.

Step 3:

To know the details of the block such as the block hash, time e.t.c, Click on the block ID. When you do you will see all the informations of the block.

To see the block hash, click on see more as shown in the screenshot below, then scroll down.

Screenshot_20210708-114136_1625750556765.jpg
Screenshot

When you do, you will see the hash of the block. For the block I used as case study, it's hash is: 0x90969e19f1c4e7e1c4cdfa33f7757ac82a46dd718b6adabf4dacf828b18a0110 as shown in the screenshot below.

Screenshot_20210708-114519_1625750592810.jpg
Screenshot

Hash of Last Transaction of the Block

Step 4:

Still on the same page, just scroll up and click on Transaction, as shown in the screenshot below.

Screenshot_20210708-114858_1625750639874.jpg
Screenshot

When you do, a page containing the whole transaction carried out on that block comes up. This is shown in the screenshot below.

Screenshot_20210708-114941_1625750668400.jpg
Screenshot

Step 5:

Then click on the latest transaction as shown in the screenshot above. When you do, you will be taking to a page containing the full details of that transaction.

The hash of the last transaction is: 0x6d6bc3fe82ade0cc3fb9758dcd6706c9bf4726b793fe9a6fe7d3a02eafb23a3d as shown in the screenshot below.

Screenshot_20210708-115456_1625750696457.jpg
Screenshot

image

Question 3: GENERATE THE HASH USING SHA-256 , FROM THE WORD CryptoAcademy AND FROM cryptoacademy. (Screenshot required). DO YOU SEE ANY DIFFERENCE BETWEEN THE TWO WORDS? EXPLAIN.

GENERATING HASH USING SHA-256

Using the link given by the provided by the professor, I followed the following steps.

Step 1:

Click on the Link provided.

Input the word "CryptoAcademy" and the click on generate.

The word CryptoAcademy generated the hash "D03CA34B258E6E0FD06B2070DDE61B50BD4EEF6161A8EDAA4A420C9AE1BEB7F9". as shown in the screenshot below.

Screenshot_20210708-121056_1625750748952.jpg
Screenshot

Step 2:

Repeating step 1 for the word "cryptoacademy"

The word "cryptoacademy" generated the hash: 0592F5DD27DC72E675B2AB9C77487A69FAAF84196597FA052EC099C18EE7C4C5
as shown in the screenshot below.

Screenshot_20210708-121226_1625750770422.jpg
Screenshot


ANY DIFFERENCE? Explain

Yes, the hash value generated for "CryptoAcademy" is totally different for the hash value obtained for the word "cryptoacademy".

I believe that the differences in the later cases between the two words (i.e C and A) made the hash function consider both words as two different words, thus the difference in the hashes.

The reason I think that's what resulted to the difference in the hashes is that I tried to create the password in another device and still got the same hashes as I got above for each of them. This implies that it that the difference in the hashes was the differences in the letter cases.

image

Question 4: IN YOUR OWN WORDS EXPLAIN THE DIFFERENCE BETWEEN HASH AND CRYPTOGRAPHY.

Although hashing and cryptography are so similar, both of them are actually very different. Below are some of the differences between them.

HashingCryptography
In hashing, the data has a fixed length valueThe length of data in Cryptography is not fixed
The output value cannot be used to generate back the input valueIn Cryptography, the input can be generated back from it's output through the use of private keys
No need to exchange private keysBoth the reciever and the sender must have access to the same private key so as to be able to decrypt sent message.
Hashing is considered to be more secured as it's irreversible, and the fact that private keys are not exchangedHow secured cryptography is, is dependent on how safe the users keep the key.

image

CONCLUSION

Hashes and Cryptography are among the founding stones upon which the crypto world is built. Without them, I don't think any computer in this world will be able to successfully process all the transactions that are carried out in a blockchain every second. Even if they can do that, they will be too slow as each of these transactions carry lots of informations in them.

Am grateful professor @pelon53 for this amazing lesson. I truly learnt a lot from it.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
STEEMKR.COM IS SPONSORED BY
ADVERTISEMENT
Sort Order:  trending

Gracias por participar en Steemit Crypto Academy Season 3:

Espero seguir leyendo tus publicaciones.

NoPreguntas.Puntaje.
1Explique ¿Qué significa la resistencia a la colisión? Y ¿Qué significa resistencia a la preimagen?2.0
2Use tronscan y etherscan para verificar el hash del último bloque y el hash de esa transacción. Se requiere capture de pantalla para su comprobación.3.0
3Genere el hash usando SHA-256, de la palabra CryptoAcademy y de cryptoacademy. Se requiere capture de pantalla. ¿Observa alguna diferencia entre ambas palabras? Explique.2.5
4En sus propias palabras explique la diferencia entre el hash y la criptografía.2.0

En la pregunta 3 queda demostrado que es resistente a la colisión.

Buen trabajo. Espero ver tus mejoras en las próximas tareas.

Recomendaciones:

  • Para mejorar la presentación debes justificar el texto.

Calificación: 9.5

·

Thank you professor @pelon53 for the review, am grateful.