org.metastatic.rsync
Class BrokenMD4

java.lang.Object
  |
  +--java.security.MessageDigestSpi
        |
        +--org.metastatic.rsync.MD4
              |
              +--org.metastatic.rsync.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.


Field Summary
 
Fields inherited from class org.metastatic.rsync.MD4
a, A, b, B, BLOCK_LENGTH, buffer, c, C, count, d, D, DIGEST_LENGTH
 
Constructor Summary
BrokenMD4()
          Trivial zero-argument constructor.
 
Method Summary
 Object clone()
           
protected  byte[] engineDigest()
          Pack the four chaining variables into a byte array.
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.
 
Methods inherited from class org.metastatic.rsync.MD4
engineDigest, engineGetDigestLength, engineReset, engineUpdate, engineUpdate, transform
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrokenMD4

public BrokenMD4()
Trivial zero-argument constructor.

Method Detail

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