Class BrokenMD4

All Implemented Interfaces:
Cloneable

public final class BrokenMD4 extends MD4 implements Cloneable

An implementation of Ron Rivest's MD4 message digest algorithm. MD4 was the precursor to the stronger MD5 algorithm, and while not considered cryptograpically secure itself, MD4 is in use in various applications. It is slightly faster than MD5.

This implementation is provided for compatibility with the "MD4" implementation in the C version of rsync -- which differs in that the input is NOT padded when the input is divisible by 64, and that only the lower 32 bits of the length is used in the padding (the real MD4 always pads the input and uses the entire 8 bytes in the padding).

DO NOT USE THIS IMPLEMENTATION IN NEW PROGRAMS.

References:

  1. The MD4 Message- Digest Algorithm.
    R. Rivest.
Version:
$Revision: 1.7 $
  • Constructor Details

    • BrokenMD4

      public BrokenMD4()
      Trivial zero-argument constructor.
  • Method Details

    • clone

      public Object clone()
      Overrides:
      clone in class MD4
    • engineDigest

      protected byte[] engineDigest()
      Pack the four chaining variables into a byte array.
      Overrides:
      engineDigest in class MD4
    • padBuffer

      protected byte[] padBuffer()
      Pad the buffer by appending the byte 0x80, then as many zero bytes to fill the buffer 8 bytes shy of being a multiple of 64 bytes, then append the length of the buffer, in bits, before padding.
      Overrides:
      padBuffer in class MD4