TechTarget.com/searchsecurity

https://www.techtarget.com/searchsecurity/tip/How-the-SHA-3-competition-declared-a-winning-hash-function

How the SHA-3 competition declared a winning hash function

By Judith Myerson

NIST recently published a journal article named "Finding Bugs in Cryptographic Hash Function Implementations," detailing how NIST revisited its five-year SHA-3 competition to find the successor to the Secure Hash Algorithm version 2 (SHA-2).

The paper details how NIST developed a new testing strategy -- and four new tests -- to find bugs in cryptographic hashing functions. The selection process took eight years, ending in August 2015 when the algorithm for the hash cryptographic function Keccak was selected for the SHA-3 competition after NIST experts didn't find bugs in its algorithms.

In this tip, we'll take a look at how NIST developed techniques to automate finding bugs in cryptographic hash functions and why using an entropy source with hashes could help uncover more bugs.

Required characteristics

As part of designing test cases to detect bugs in the hashing algorithms in the SHA-3 competition, the NIST authors developed four tests that corresponded to four desired properties of a cryptographic hash function. These properties included the following:

Test approaches

Starting from these four properties of cryptographic hash functions, the authors of the NIST report -- Nicky Mouha, Mohammad S Raunak, D. Richard Kuhn and Raghu Kacker -- developed four approaches to testing the reference implementations of the SHA-3 candidate algorithms, including:

Five hash functions

The tests focused mostly on bugs that were discovered in the five SHA-3 implementations that demonstrated why bugs in the hash functions escaped detection during the SHA-3 selection process.

One of the five finalists of the SHA-3 competition was the BLAKE hash function; however, the NIST authors found a bug in the source code of every one of the BLAKE reference implementations. Although the bug was fixed by the BLAKE designer as of 2016, it was rediscovered by the report's authors. The bug affected all sizes of the hash function, and later versions have been used in many protocols.

A second hash function, JH, was designed by Hongjun Wu. All JH implementations shared a bug: they read bits outside of the bounds of the message that are not a multiple of eight bits, which is required by the NIST API. The NIST authors detected this bug using the Bit-Exclusion Test.

Fugue, another of the hash functions, was designed by Shai Halevi, Eric Hall and Charanjit Jutla of the IBM Thomas J. Watson Research Center. A few months after advancing to the second round, Jutla announced that Stefan Tillich discovered a bug in the Fugue implementation. Erroneous implementations occurred with all the messages for which the length was not divisible by eight.

The Hamsi hash function was designed by Özgül Küçük. All Hamsi implementations were submitted in the first round, but they didn't make it to the second round. The NIST authors found serious bugs in the 384-bit and 512-bit hash outputs -- only half of the message bits were processed.

The fifth and final hash function finalist, LANE, was selected for the first round, but it failed to reach the second round. The Update Test discovered an extremely dangerous bug that ensured the same hash value would be returned for all the messages of a particular length.

Entropy for hash functions

In order to reduce bugs, I believe that all the non-winning hash functions from the SHA-3 competition should be applied to an entropy source to reduce bugs. The tests didn't account for entropy to generate random bits for use in cryptography. However, if an entropy source doesn't work properly, then the hash function tests will fail; entropy as a service could be used on low-entropy devices.

The hash function Keccak, published in NIST FIPS 202 as SHA-3, is not widely accepted due to its slower software speeds than SHA-2 -- which replaced deprecated SHA-1. Support for SHA-3 is generally not available for most software and hardware as code, and firmware needs to be customized for each device. SHA-3 also hasn't been applied to entropy sources to reduce or eliminate the flaws that the NIST authors failed to detect in their tests.

All hash functions should be applied to an entropy source before starting any test approaches. If this had been done, then the flaws in Keccak might have been detected earlier.

11 Dec 2018

All Rights Reserved, Copyright 2000 - 2025, TechTarget | Read our Privacy Statement