CryptographyZero KnowledgeBlockChain

Hashing Algorithms

By Joel Lozano
Picture of the author
Published on
hashing-algorithms

💡Key Ideas:

In cryptography, hash functions transform input data of arbitrary size (e.g. a text message) to a result of fixed size (e.g. 256 bits), which is called hash value (or hash code, message digest, or simply hash).

Hash functions (hashing algorithms) used in computer cryptography are known as "cryptographic hash functions". Examples of such functions are SHA-256 and SHA3-256, which transform arbitrary input to 256-bit output.

Properties we want:

  • Collision-resistance: no two input values generate the same hash value.
  • Irreversible: hard to find the input value from the hash value (output data)
  • It's important because it allows me to:

Generate a unique identifier (fingerprint) to a huge amount of information

Verify that the underlying data doesn't change

Maintain the underlying data private

Common Hashing Algorithms or Hash Funcitons used in Ethereum/Blockchain:

  • SHA-256
  • Blake2
  • Keccak
  • Poseidon
  • Pedersen

🔗Links:

Cryptobook - Hash Functions

PSE Core Program 2023 -Hash Functions

ETH Build Sandbox

Fileformat - Hash

Online Tools - Sha256

SHA256 Algorithm Visually

🛠️ Build and Practice:

Implement hashing algorithms in a language of your choice (web2 like TypeScript, Rust, C++, C#, Go or a web3 language like Cairo, Solidity, Noir, Circom)

Stay Tuned

Get informed about the latest publications
The best articles, links and news related to web development delivered once a week to your inbox.