level
Expert Level Reading
27 May, 2024

BLAKE-256 Hash Function

[ Bleyk too huhn-drid uhn fif-tee siks ]

Blake-256 is an efficient one-way function to encrypt data of any length in a 256-bit string.

Suchet Dhindsa Salvesen
Written by
Suchet Salvesen
Suchet Dhindsa Salvesen Suchet Salvesen Expert Author
Suchet is a Norwegian economist, entrepreneur, and investor, serving as the CFO and COO of Brainfund. With over a decade of experience in global expansion, venture capital, and emerging technologies, he earned his MBA from the NMBU School of Business & Economics. He held dual bachelor's degrees from the University of South-Eastern Norway. His career...
Fact checked by
Matthew Low
Matthew Low Expert
Matthew James Low is an accomplished fintech and digital technology expert with over a decade of diverse experience. He has held notable positions at IBM, Elixirr Consulting, and Autonomous Research, where he demonstrated strategic acumen, leadership, and expertise in emerging technologies. Matthew has successfully launched entrepreneurial ventures such as Spazapp Systems, TapTuck, and QPQ. He...

A History of Blake Hash Family Algorithm

Blake-256 is an iterated hash function that was designed in 2010 by Jean-Philippe Aumasson, Luca Henzen, Willi Meier, and Raphael C.-W. Phan.

It belongs to the original algorithmic family BLAKE, based on Daniel J Bernstein’s ChaCha stream cipher—not to be confused with BLAKE2 (2012) and BLAKE3 (2020). 

“BLAKE hash algorithm is a hash functions family comprised of four members, BLAKE-224, BLAKE-256, BLAKE384, and BLAKE-512.”

Jean-Philippe Aumasson
Modified compact BLAKE-256 design and its timeline
Modified compact BLAKE-256 design and its timeline | Source: ccs.ee.tut.ac.jp

Blake-256 was developed between 2008 and 2012 during the NIST hash function competition, which was aiming to create a next SHA-3 generation to complement SHA-1 and SHA-2. For reference, the Bitcoin blockchain uses SHA-256, a variant of the latter.

SHA-256 encryption example
SHA-256 encryption example | Source: Nordvpn.com

After reviewing 51 different functions, Blake-256 was selected among the top five fastest and most secure. Although it lost the SHA-3 competition to “Keccak,” it’s still a versatile function used by tokens such as Decred ($DCR).

What Is Blake-256?

Blake-256 is a BLAKE hash function that efficiently encrypts large amounts of information into a fixed bit size of 32, also called words.

This is more efficient than 64-bit variants regarding simple tasks (such as hashing blockchain transactions).

Properties of the BLAKE hash functions
Properties of the BLAKE hash functions (sizes in bits) | Source: citeseerx.ist.psu.edu

As in the SHA-256 example from before, Blake-256 generates similar results by following a different algorithm design. This means:

  • Blake-256 permutates 32-bit words to generate a fixed 256-bit text code (the hash), whether the data is one letter or an entire book. The limit is around two billion terabytes.
  • Entering identical data should generate the same hash
  • The tiniest data changes generate a different hash

Unlike SHA-256, Blake-256 adds a security layer called salt. This acts as a 128-bit password generated randomly that combines with the message at the initialization stage, which later results in the hash (also called digest).

This means, users need to save both the identical message and “salt” code to generate the same hash. Hashing the identical text alone will not generate the same hash.

Initialization

Before encrypting the message, Blake-256 initializes two variable groups involved in the algorithm – the initial state and constants:

Blake-256 Constants
Blake-256 Constants | Source: Decred.org

The function represents the 16 words in a 4×4 matrix and includes the “salt” so that different inputs produce different states. 

Then, the message is separated into blocks of 512 bits (16 words of 32 bits each) to be hashed independently.

Rounds

For each 512-bit block, the algorithm applies two compression functions while mixing the predefined constants. Each compression consists of 14 mathematical transformations called rounds, and each round calls the “G function” 8 times to improve the diffusion and minimize self-similarity.

After updating the internal state with 14 rounds, the next block is combined with it, and the process repeats. After adding the last block, the final state is converted to 256 bits.

What Is The Role of Blake-256?

Blake-256 serves as a secure and efficient cryptographic tool, including use cases outside cryptocurrencies. This function can be seamlessly applied to all blockchain steps, from crypto mining to block creation and validation.

doc ico
Article Sources
arrow ico

Coinweb requires writers to use primary sources to support their work. These include white papers, government data, original reporting, and interviews with industry experts. We also reference original research from other reputable publishers. You can learn more about the standards we follow in producing accurate, unbiased content in our editorial process.

Suchet Dhindsa Salvesen
Written by

Suchet is a Norwegian economist, entrepreneur, and investor, serving as the CFO and COO of Brainfund. With over a decade of experience in global expansion, venture capital, and emerging technologies, he earned his MBA from the NMBU School of Business & Economics. He held dual bachelor’s degrees from the University of South-Eastern Norway. His career spans roles at NextToMe, Get, and Conax before joining Everipedia, now Brainfund, in 2017.

More crypto lingo