Package io.milton.zsync
Class BrokenMD4
java.lang.Object
java.security.MessageDigestSpi
io.milton.zsync.MD4
io.milton.zsync.BrokenMD4
- All Implemented Interfaces:
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:
- The MD4 Message-
Digest Algorithm.
R. Rivest.
- Version:
- $Revision: 1.7 $
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()protected byte[]Pack the four chaining variables into a byte array.protected byte[]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 io.milton.zsync.MD4
engineDigest, engineGetDigestLength, engineReset, engineUpdate, engineUpdate, transformMethods inherited from class java.security.MessageDigestSpi
engineUpdate
-
Constructor Details
-
BrokenMD4
public BrokenMD4()Trivial zero-argument constructor.
-
-
Method Details
-
clone
-
engineDigest
protected byte[] engineDigest()Pack the four chaining variables into a byte array.- Overrides:
engineDigestin classMD4
-
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.
-