cryptix.provider.md

Class MD5

Implemented Interfaces:
Cloneable

public final class MD5
extends BlockMessageDigest
implements Cloneable

This class implements the MD5 message digest algorithm.

BUG: The update method is missing.

References:

  1. Ronald L. Rivest, " The MD5 Message-Digest Algorithm", IETF RFC-1321 (informational).
  2. Bruce Schneier, "Section 18.5 MD5," Applied Cryptography, 2nd edition, John Wiley & Sons, 1996

Copyright © 1995-1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.8 $

Authors:
Systemics Ltd
David Hopwood
Since:
Cryptix 2.2

Constructor Summary

MD5()
The public constructor.

Method Summary

protected static int
F(int x, int y, int z)
protected static int
FF(int a, int b, int c, int d, int k, int s, int t)
protected static int
G(int x, int y, int z)
protected static int
GG(int a, int b, int c, int d, int k, int s, int t)
protected static int
H(int x, int y, int z)
protected static int
HH(int a, int b, int c, int d, int k, int s, int t)
protected static int
I(int x, int y, int z)
protected static int
II(int a, int b, int c, int d, int k, int s, int t)
Object
clone()
Returns a copy of this MD object.
protected byte[]
engineDigest(byte[] in, int length)
Returns the digest of the data added and resets the digest.
protected int
engineGetDataLength()
Returns the length of the data (in bytes) hashed in every transform.
protected int
engineGetDigestLength()
Returns the length of the hash (in bytes).
protected void
engineReset()
Initializes (resets) the message digest.
protected void
engineTransform(byte[] in)
Adds data to the message digest.
static void
main(argv[] )
Entry point for self_test.
static void
self_test()
Do some basic tests.
protected void
transform(M[] )

Methods inherited from class cryptix.provider.md.BlockMessageDigest

bitcount, engineDigest, engineDigest, engineGetDataLength, engineReset, engineTransform, engineUpdate, engineUpdate

Constructor Details

MD5

public MD5()
The public constructor.

Method Details

F

protected static int F(int x,
                       int y,
                       int z)

FF

protected static int FF(int a,
                        int b,
                        int c,
                        int d,
                        int k,
                        int s,
                        int t)

G

protected static int G(int x,
                       int y,
                       int z)

GG

protected static int GG(int a,
                        int b,
                        int c,
                        int d,
                        int k,
                        int s,
                        int t)

H

protected static int H(int x,
                       int y,
                       int z)

HH

protected static int HH(int a,
                        int b,
                        int c,
                        int d,
                        int k,
                        int s,
                        int t)

I

protected static int I(int x,
                       int y,
                       int z)

II

protected static int II(int a,
                        int b,
                        int c,
                        int d,
                        int k,
                        int s,
                        int t)

clone

public Object clone()
Returns a copy of this MD object.

engineDigest

protected byte[] engineDigest(byte[] in,
                              int length)
Returns the digest of the data added and resets the digest.
Overrides:
engineDigest in interface BlockMessageDigest
Returns:
the digest of all the data added to the message digest as a byte array.

engineGetDataLength

protected int engineGetDataLength()
Returns the length of the data (in bytes) hashed in every transform.
Overrides:
engineGetDataLength in interface BlockMessageDigest

engineGetDigestLength

protected int engineGetDigestLength()
Returns the length of the hash (in bytes).

engineReset

protected void engineReset()
Initializes (resets) the message digest.
Overrides:
engineReset in interface BlockMessageDigest

engineTransform

protected void engineTransform(byte[] in)
Adds data to the message digest.
Overrides:
engineTransform in interface BlockMessageDigest
Parameters:

main

public static final void main(argv[] )
Entry point for self_test.

self_test

public static final void self_test()
            throws Exception
Do some basic tests. Three of the validation data are included only, no output, success or exception. If you want more, write a test program!
See Also:
cryptix.examples.UnitMD5

transform

protected void transform(M[] )