Crypto Academy / Season 3 / Week 2 - Homework Post for @pelon53

in SteemitCryptoAcademy3 years ago

HASH.jpg

Hash

A hash is a mathematical function tht encodes data input of any size into alphanumeric characters of a fixed length. Hashed data are of fixed length and cannot be reversed to obtain the original data.

The irreversible and unique nature of the hash function makes it very secure. Because of this high security, hash is used in blockchain technology.


A5tMjLhTTnj4UJ3Q17DFR9PmiB5HnomwsPZ1BrfGqKbjdeopH922TMtWieLT155635NRt7dVnyAqtrL9RGmZvUX29t21ncxTZCat7nrXd9ZC38fNr7KTxXmvt3EEW5...zTownnuAmDsoBvrDom4humfLJQk4M49fpLof2Vze8zg8MMTvaewKH1orgP1YGTYsPfGTDcLU77V7vc8bTtAUjyqNmT9kSCKY54YiBnCdcoFf7UByRsF4urxYva.png

Resistance to Collision

Hash functions are very unique. This means that each hash is entirely different from another. But there are situations when different data would produce the same hash. This is known as collision.

Resistance to collision is an attribute of the hash function that ensures that more than one data do not have the same hash output.

That is; p ≠ q, H(p) ≠ H(q)
where p and q are two distinct inputs, and H is the hash function.

All hash functions are prone to collision. A low possibility of collision implies a greater resistance to collision. One of the reasons why the SHA-256 is most commonly used is because of its great resistance to collision.

Resistance to Collision is also known as Second-Preimage Resistance.


A5tMjLhTTnj4UJ3Q17DFR9PmiB5HnomwsPZ1BrfGqKbjdeopH922TMtWieLT155635NRt7dVnyAqtrL9RGmZvUX29t21ncxTZCat7nrXd9ZC38fNr7KTxXmvt3EEW5...zTownnuAmDsoBvrDom4humfLJQk4M49fpLof2Vze8zg8MMTvaewKH1orgP1YGTYsPfGTDcLU77V7vc8bTtAUjyqNmT9kSCKY54YiBnCdcoFf7UByRsF4urxYva.png

Resistance to Preimage

Resistance to preimage entails the difficulty or impossibility of finding the input for a specific hash output.

  • Given an output "q",
  • resistance to preimage makes it difficult to find a value, "p",
  • for which p = H(q);
  • where "H" is the hash functions.

The property of hash functions that make them irreversible gives rise to resistance of preimage.

Resistance to preimage can be compromised using brute-force attack, which involves randomly guessing the passwords or keys by examining the outputs.


A5tMjLhTTnj4UJ3Q17DFR9PmiB5HnomwsPZ1BrfGqKbjdeopH922TMtWieLT155635NRt7dVnyAqtrL9RGmZvUX29t21ncxTZCat7nrXd9ZC38fNr7KTxXmvt3EEW5...zTownnuAmDsoBvrDom4humfLJQk4M49fpLof2Vze8zg8MMTvaewKH1orgP1YGTYsPfGTDcLU77V7vc8bTtAUjyqNmT9kSCKY54YiBnCdcoFf7UByRsF4urxYva.png

Verifying Hash on Etherscan

Etherscan is the blockchain explorer of the Ethereum network.


Block

Snapchat-603810430_1.jpg

The image above shows some data on the last block as of the time of writing. It's hash is 0x0f284c93073f391e879173bc684c6738523b11d3d0c6c9cb991a19cf1cbdd3ce.


Transaction

Snapchat-1409018117.jpg

The image above gives details of the last transaction on the Ethereum blockchain as of the time of writing. Its hash value is Ox6ccce8294621665cf09cfa5e914e1b3cd2389d9d801833ae9349c06201.


A5tMjLhTTnj4UJ3Q17DFR9PmiB5HnomwsPZ1BrfGqKbjdeopH922TMtWieLT155635NRt7dVnyAqtrL9RGmZvUX29t21ncxTZCat7nrXd9ZC38fNr7KTxXmvt3EEW5...zTownnuAmDsoBvrDom4humfLJQk4M49fpLof2Vze8zg8MMTvaewKH1orgP1YGTYsPfGTDcLU77V7vc8bTtAUjyqNmT9kSCKY54YiBnCdcoFf7UByRsF4urxYva.png

Verifying Hash on Tronscan

Tronscan is the blockchain explorer of the the Tron network.


Block

Snapchat-1737886528.jpg

The image above gives data on the last block on the Tron blockchain as of the time of writing. Its hash value is 0000000001e4314b1fef38e814a128f1f5cf3437259d15773370cf70460d0853.


Transaction

Snapchat-581399657.jpg

The image above gives data on the last transaction on the Tron blockchain as of the time of writing. It has a hash value of 3f9449d9bd0de9f498df04a49171c609fc39b1dd85f276828717de8cd29602b0.


A5tMjLhTTnj4UJ3Q17DFR9PmiB5HnomwsPZ1BrfGqKbjdeopH922TMtWieLT155635NRt7dVnyAqtrL9RGmZvUX29t21ncxTZCat7nrXd9ZC38fNr7KTxXmvt3EEW5...zTownnuAmDsoBvrDom4humfLJQk4M49fpLof2Vze8zg8MMTvaewKH1orgP1YGTYsPfGTDcLU77V7vc8bTtAUjyqNmT9kSCKY54YiBnCdcoFf7UByRsF4urxYva.png

Generating Hash using SHA-256

This task requires that I use this site here

I inputed the word "CryptoAcademy" and it generated a hash with the value D03CA34B258E6E0FD06B2070DDE61B50BD4EEF6161A8EDAA4A420C9AE1BEB7F9.

Snapchat-1206459998.jpg


For the second task, I inputed the word "cryptoacademy". It generated a hash with the value 0592F5DD27DC72E675B2AB9C77487A69FAAF84196597FA052EC099C18EE7C4C5.

Snapchat-1489587535.jpg


Observation

I observed that the two inputs generated different hashes. Although the words are the same, the characters that make up the words are different. The uppercase and lowercase case letters made a difference in the hash value. This shows that the hash function has a resistance to collision.


A5tMjLhTTnj4UJ3Q17DFR9PmiB5HnomwsPZ1BrfGqKbjdeopH922TMtWieLT155635NRt7dVnyAqtrL9RGmZvUX29t21ncxTZCat7nrXd9ZC38fNr7KTxXmvt3EEW5...zTownnuAmDsoBvrDom4humfLJQk4M49fpLof2Vze8zg8MMTvaewKH1orgP1YGTYsPfGTDcLU77V7vc8bTtAUjyqNmT9kSCKY54YiBnCdcoFf7UByRsF4urxYva.png

Differences Between Hash and Cryptography

By definition, a hash is cryptographic function that encrypts a set of data strings by generating a combination of alphanumeric characters from each character from the data string.

On the other hand, cryptography is the method of encoding data or information, such that only parties involved can gain access to the contents of the encryption with the use of keys.

The differences between these two terms are as follows:

HashCryptography
Each hash algorithm has their individual fixed size and character length irrespective of the data length or size. Example: SHA-512 generates 128 characters while SHA-256 generates 64 charactersSize of encryption depends on the size of information
Hashed data cannot be reversedEncrypted data can be retrieved
Keys have no function in hashingPrivate and/or public keys are provided for decrypting data


A5tMjLhTTnj4UJ3Q17DFR9PmiB5HnomwsPZ1BrfGqKbjdeopH922TMtWieLT155635NRt7dVnyAqtrL9RGmZvUX29t21ncxTZCat7nrXd9ZC38fNr7KTxXmvt3EEW5...zTownnuAmDsoBvrDom4humfLJQk4M49fpLof2Vze8zg8MMTvaewKH1orgP1YGTYsPfGTDcLU77V7vc8bTtAUjyqNmT9kSCKY54YiBnCdcoFf7UByRsF4urxYva.png

Conclusion

Hashing is a method of ensuring security of data and information. With this lesson, I have gained knowledge on hashing and it's functions. I have understood the concepts of collision and preimage in hashing.

I'll like to make this note to all my readers. Hashing is a form of cryptography. Cryptography simply involves methods of securing computational data. Hashing is one of these methods.

Special thanks to @pelon53.

Sort:  
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.2.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.8
4En sus propias palabras explique la diferencia entre el hash y la criptografía.1.8

El la pregunta 2 no coincide el número de bloque con el hash de la transacción encontrada. Son bloques diferentes y debe ser el mismo bloque. En tronsacan uno es 31732043 y el otro 31732060.

Buen trabajo, sigue adelante.

Recomendaciones:


Debes explicar más como ingresas a la página de tronscan y etherscan. Las respuestas deben ser fáciles de comprender.

Calificación: 8.6

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 62227.11
ETH 2400.78
USDT 1.00
SBD 2.50