JH is a
cryptographic hash function
A cryptographic hash function (CHF) is a hash algorithm (a map (mathematics), map of an arbitrary binary string to a binary string with a fixed size of n bits) that has special properties desirable for a cryptography, cryptographic application: ...
submitted to the
NIST hash function competition
The NIST hash function competition was an open competition held by the US National Institute of Standards and Technology (NIST) to develop a new hash function called SHA-3 to complement the older SHA-1 and SHA-2. The competition was formally a ...
by Hongjun Wu. Though chosen as one of the five finalists of the competition, in 2012 JH ultimately lost to NIST hash candidate
Keccak
SHA-3 (Secure Hash Algorithm 3) is the latest member of the Secure Hash Algorithm family of standards, released by NIST on August 5, 2015. Although part of the same series of standards, SHA-3 is internally different from the MD5-like struct ...
.
JH has a 1024-bit state, and works on 512-bit input blocks. Processing an input block consists of three steps:
# XOR the input block into the left half of the state.
# Apply a 42-round unkeyed permutation (encryption function) to the state. This consists of 42 repetitions of:
## Break the input into 256 4-bit blocks, and map each through one of two 4-bit
S-box
In cryptography, an S-box (substitution-box) is a basic component of symmetric key algorithms which performs substitution. In block ciphers, they are typically used to obscure the relationship between the key and the ciphertext, thus ensuring Clau ...
es, the choice being made by a 256-bit round-dependent key schedule. Equivalently, combine each input block with a key bit, and map the result through a 5→4 bit S-box.
## Mix adjacent 4-bit blocks using a
maximum distance separable code
In coding theory, the Singleton bound, named after the American mathematician Richard Collom Singleton (1928–2007), is a relatively crude upper bound on the size of an arbitrary block code C with block length n, size M and minimum distance d. It ...
over
GF(24).
## Permute 4-bit blocks so that they will be adjacent to different blocks in following rounds.
# XOR the input block into the right half of the state.
The resulting digest is the last 224, 256, 384 or 512 bits from the 1024-bit final value.
It is well suited to a
bit slicing
Bit slicing is a technique for constructing a processor from modules of processors of smaller bit width, for the purpose of increasing the word length; in theory to make an arbitrary ''n''-bit central processing unit (CPU). Each of these c ...
implementation using the
SSE2
SSE2 (Streaming SIMD Extensions 2) is one of the Intel SIMD (Single Instruction, Multiple Data) processor supplementary instruction sets introduced by Intel with the initial version of the Pentium 4 in 2000. SSE2 instructions allow the use of ...
instruction set, giving speeds of 16.8
cycles per byte.
Examples of JH hashes
Hash values of empty string.
JH-224("")
0x 2c99df889b019309051c60fecc2bd285a774940e43175b76b2626630
JH-256("")
0x 46e64619c18bb0a92a5e87185a47eef83ca747b8fcc8e1412921357e326df434
JH-384("")
0x 2fe5f71b1b3290d3c017fb3c1a4d02a5cbeb03a0476481e25082434a881994b0ff99e078d2c16b105ad069b569315328
JH-512("")
0x 90ecf2f76f9d2c8017d979ad5ab96b87d58fc8fc4b83060f3f900774faa2c8fabe69c5f4ff1ec2b61d6b316941cedee117fb04b1f4c5bc1b919ae841c50eec4f
Even a small change in the message will (with overwhelming probability) result in a mostly different hash, due to the
avalanche effect
In cryptography, the avalanche effect is the desirable property of cryptographic algorithms, typically block ciphers and cryptographic hash functions, wherein if an input is changed slightly (for example, flipping a single bit), the output changes ...
. For example, adding a period to the end of the sentence:
JH-256("The quick brown fox jumps over the lazy dog
"The quick brown fox jumps over the lazy dog" is an English-language pangram a sentence (linguistics), sentence that contains all the letters of the alphabet. The phrase is commonly used for Touch typing, touch-typing practice, testing typewrit ...
")
0x 6a049fed5fc6874acfdc4a08b568a4f8cbac27de933496f031015b38961608a0
JH-256("The quick brown fox jumps over the lazy dog
"The quick brown fox jumps over the lazy dog" is an English-language pangram a sentence (linguistics), sentence that contains all the letters of the alphabet. The phrase is commonly used for Touch typing, touch-typing practice, testing typewrit ...
.")
0x d001ae2315421c5d3272bac4f4aa524bddd207530d5d26bbf51794f0da18fafc
References
External links
The JH web site
JH page on the SHA-3 ZooVHDL source code developed by the Cryptographic Engineering Research Group (CERG) at George Mason University
NIST hash function competition
{{crypto-stub