User Rating 0.0
Total Usage 0 times
1 – 1000
Is this tool helpful?

Your feedback helps us improve.

About

MD4 is a 128-bit cryptographic hash function designed by Ronald Rivest in 1990, specified in RFC 1320. It processes input through three rounds of 16 operations on 512-bit blocks, producing a 32-character hexadecimal digest. While MD4 is cryptographically broken for security purposes (collision attacks exist with complexity < 28 operations), it remains relevant in legacy protocol analysis, NTLM authentication research, and as a pedagogical reference for understanding Merkle - Damgård construction. This tool computes genuine MD4 digests from cryptographically random inputs via crypto.getRandomValues(). It does not simulate or truncate SHA-256. Each output is a valid MD4 hash verifiable against any RFC 1320 reference implementation.

Generating predictable or low-entropy hashes for test fixtures leads to false positives in collision detection tests and unreliable deduplication benchmarks. This generator ensures each input seed contains 128 bits of entropy (16 random bytes), guaranteeing uniform distribution across the 2128 output space. Note: MD4 must not be used for password hashing, digital signatures, or any integrity-critical application. Use SHA-256 or BLAKE3 for those.

md4 hash generator random hash md4 hash checksum hex digest rfc 1320 cryptographic hash

Formulas

MD4 initializes four 32-bit state registers and processes the padded message in 512-bit blocks. Each block undergoes three rounds with distinct auxiliary functions:

F(X, Y, Z) = (X Y) (¬X Z)
G(X, Y, Z) = (X Y) (X Z) (Y Z)
H(X, Y, Z) = X &xor; Y &xor; Z

The state registers are initialized to: A = 0x67452301, B = 0xEFCDAB89, C = 0x98BADCFE, D = 0x10325476. Round 1 uses F with additive constant 0x00000000. Round 2 uses G with constant 0x5A827999 (the square root of 2). Round 3 uses H with constant 0x6ED9EBA1 (the square root of 3). Message padding appends a 1 bit, then zeros, then the 64-bit message length in little-endian, ensuring total length 0 (mod 512). The final digest is the concatenation of registers A, B, C, D in little-endian byte order, yielding 128 bits (32 hex characters).

Where X, Y, Z = 32-bit words from the state registers. = bitwise AND. = bitwise OR. ¬ = bitwise NOT. &xor; = bitwise XOR. Each round applies circular left shifts by variable amounts (3, 7, 11, 19 in Round 1; 3, 5, 9, 13 in Round 2; 3, 9, 11, 15 in Round 3).

Reference Data

Hash FunctionDigest SizeBlock SizeRoundsYearStatusDesignerOperations/RoundCollision ResistanceUse Case Today
MD4128 bit512 bit31990BrokenRivest16< 28NTLM research, legacy
MD5128 bit512 bit41992BrokenRivest16218Checksums (non-security)
SHA-1160 bit512 bit41995BrokenNSA20263Git (migrating away)
SHA-256256 bit512 bit642001SecureNSA12128TLS, Bitcoin, signatures
SHA-384384 bit1024 bit802001SecureNSA12192TLS certificates
SHA-512512 bit1024 bit802001SecureNSA12256High-security hashing
SHA-3 (256)256 bit1088 bit242015SecureBertoni et al.12128Post-quantum readiness
BLAKE2b512 bit1024 bit122012SecureAumasson et al.12256Fast secure hashing
BLAKE3256 bit512 bit72020SecureO'Connor et al.12128Fastest secure hash
RIPEMD-160160 bit512 bit51996WeakenedDobbertin et al.16280Bitcoin address derivation
Whirlpool512 bit512 bit102000SecureRijmen & Barreto12256ISO/IEC 10118-3
Tiger192 bit512 bit241996WeakenedAnderson & Biham1296P2P file verification

Frequently Asked Questions

Dobbertin demonstrated collisions in MD4's compression function in 1996. Wang et al. later published a full collision attack in 2004 with complexity under 28 MD4 operations - essentially instantaneous on modern hardware. This means two distinct inputs can produce identical MD4 digests trivially. For comparison, a secure hash like SHA-256 requires approximately 2128 operations for collision, which exceeds the computational capacity of all existing hardware combined.
Each hash is computed from 16 bytes (128 bits) of entropy sourced from crypto.getRandomValues(), which draws from the operating system's CSPRNG (e.g., /dev/urandom on Linux, BCryptGenRandom on Windows). Since the input space (2128 possible seeds) matches the output space (2128 possible digests), and MD4's compression function is a surjective mapping for random inputs, the output distribution is effectively uniform. No two generated hashes will collide in practice.
MD4 persists in Microsoft's NTLM authentication protocol, where passwords are hashed with MD4 before transmission. It also appears in legacy Ed2k/eDonkey file-sharing checksums and certain older S/MIME implementations. The rsync algorithm historically used MD4 for rolling checksums (replaced by xxHash in rsync 3.2.3+). Understanding MD4 output format is necessary for security auditing of these legacy systems.
The random bytes are the 16-byte (128-bit) seed generated by the CSPRNG. This seed is then processed through the full MD4 algorithm: padded to 512 bits, split into sixteen 32-bit words, and run through 48 operations across 3 rounds. The resulting 128-bit digest bears no recognizable relationship to the input due to the avalanche effect - changing a single input bit flips approximately 50% of output bits.
Yes. This tool implements MD4 per RFC 1320 exactly. You can verify by hashing a known input. For example, MD4("") = 31d6cfe0d16ae931b73c59d7e0c089c0, and MD4("abc") = a448017aaf21d8525fc10ae87aa6729d. The generator uses random inputs, but if you capture both the hex-encoded input bytes and the output hash, any RFC 1320-compliant library (e.g., Python's hashlib with legacy providers, OpenSSL's md4 command) will produce the same digest.
MD5 added a fourth round (increasing from 48 to 64 total operations), introduced a per-step additive constant derived from the sine function (replacing MD4's fixed per-round constants), and changed the message word selection order. MD5 also uses different shift amounts. These changes improved diffusion but did not prevent eventual collision attacks. Both use the same Merkle - Damgård construction, identical initial register values, and identical padding schemes.