HAVAL128,4 Hash Tool
Other Hash Generator
MD2 MD4 MD5 SHA1 SHA224 SHA256 SHA384 SHA512/224 SHA512/256 SHA512 SHA3-224 SHA3-256 SHA3-384 SHA3-512 RIPEMD128 RIPEMD160 RIPEMD256 RIPEMD320 WHIRLPOOL TIGER128,3 TIGER160,3 TIGER192,3 TIGER128,4 TIGER160,4 TIGER192,4 SNEFRU SNEFRU256 GOST GOST-CRYPTO ADLER32 CRC32 CRC32B CRC32C FNV132 FNV1A32 FNV164 FNV1A64 JOAAT MURMUR3A MURMUR3C MURMUR3F XXH32 XXH64 XXH3 XXH128 HAVAL128,3 HAVAL160,3 HAVAL192,3 HAVAL224,3 HAVAL256,3 HAVAL128,4 HAVAL160,4 HAVAL192,4 HAVAL224,4 HAVAL256,4 HAVAL128,5 HAVAL160,5 HAVAL192,5 HAVAL224,5 HAVAL256,5Introduction
HAVAL-128/4 is a cryptographic hash function designed to produce a 128-bit message digest. It belongs to the HAVAL family, which allows variable-length outputs and configurable numbers of rounds for processing data. The specific variant “128/4” indicates a 128-bit hash output computed using four transformation rounds.
Input Processing
The algorithm accepts input of arbitrary length and begins by padding the message to a multiple of 1024 bits. Padding involves appending a single '1' bit, followed by enough '0' bits, and finally appending a 128-bit representation of the original message length. The padded message is divided into 1024-bit blocks for sequential processing.
Initialization
HAVAL-128/4 uses eight 32-bit initial values to set up the internal state. These values are predefined constants derived from fractional parts of sine values, providing a fixed starting point for the iterative compression process. Each 32-bit word of the initial state is stored in a separate internal register labeled A through H.
Compression Function
The core of HAVAL-128/4 is its compression function, applied to each 1024-bit block. The function consists of four rounds, each containing 32 steps. During each step, a nonlinear function is applied to a combination of the internal state registers and a portion of the current message block. Bitwise operations such as AND, OR, XOR, and NOT are used along with modular addition. Each step modifies the internal state, progressively mixing input bits into the hash computation.
Message Expansion
Within each round, portions of the message block are permuted according to a predefined schedule. This permutation ensures that every bit of the input influences multiple steps, improving diffusion. Intermediate values from previous rounds are also reused to enhance avalanche effect and resist cryptanalytic attacks.
Finalization
After processing all message blocks, the final 128-bit hash is generated by combining selected internal state registers. The resulting digest represents a fixed-size summary of the input data, designed to be collision-resistant and irreversible. The output can then be encoded in hexadecimal or binary format for storage or comparison.
Properties
HAVAL-128/4 supports four rounds, which offers a balance between computational efficiency and security. Its design includes multiple nonlinear functions and bitwise operations that make it resistant to standard hash attacks, including differential and linear cryptanalysis. The algorithm is deterministic, meaning identical input always produces the same output, and minor changes in input yield entirely different hashes due to the avalanche effect.
Usage
This variant is suitable for applications where moderate speed and security are required. It is implemented in software libraries and cryptographic tools, providing functions for hash computation, integrity verification, and digital signatures. HAVAL-128/4 can be integrated into larger cryptographic protocols that rely on fixed-length message digests.