Class cryptix.security.MD5
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.security.MD5

java.lang.Object
   |
   +----cryptix.security.MessageDigest
           |
           +----cryptix.security.MD5

public final class MD5
extends MessageDigest
This class implements the MD5 message digest.

Copyright (C) 1995, 1996 Systemics Ltd (http://www.systemics.com/) All rights reserved.


Variable Index

 o data
 o DATA_LENGTH
 o digest
 o HASH_LENGTH
Length of the final hash (in bytes).
 o tmp

Constructor Index

 o MD5()
The public constructor.

Method Index

 o byte2int(int[], int, byte[], int, int)
 o CreateHash(byte[])
Returns the hash of a single byte array.
 o data_length()
Return length of the data (in bytes) hashed in every transform.
 o digestAsHash()
Returns the digest of the data added and resets the digest.
 o F(int, int, int)
 o FF(int, int, int, int, int, int, int)
 o G(int, int, int)
 o getLinkErrorString()
 o GG(int, int, int, int, int, int, int)
 o H(int, int, int)
 o hasFileLibraryLoaded()
 o hash(byte[])
Returns the hash of a single byte array.
 o hash(String)
Returns the hash of a single string.
 o hash_length()
Return length of the hash (in bytes).
 o hashAsMessageHash(byte[])
Returns the MessageHash of a single byte array.
 o hashAsMessageHash(String)
Returns the MessageHash of a single string.
 o HH(int, int, int, int, int, int, int)
 o I(int, int, int)
 o II(int, int, int, int, int, int, int)
 o isLibraryCorrect()
 o java_transform()
 o main(String[])
 o md_digest()
Returns the digest of the data added and resets the digest.
 o md_reset()
Initialise (reset) the message digest.
 o md_transform()
Add data to the message digest
 o name()
Return name of this hash function.
 o self_test(PrintStream, String[])
 o transform(int[])

Variables

 o HASH_LENGTH
  public final static int HASH_LENGTH
Length of the final hash (in bytes).
 o DATA_LENGTH
  public final static int DATA_LENGTH
 o data
  protected int data[]
 o digest
  protected int digest[]
 o tmp
  protected byte tmp[]

Constructors

 o MD5
  public MD5()
The public constructor.

Methods

 o hasFileLibraryLoaded
  public final static boolean hasFileLibraryLoaded()
 o isLibraryCorrect
  public final static boolean isLibraryCorrect()
 o getLinkErrorString
  public final static String getLinkErrorString()
 o hash_length
  public final int hash_length()
Return length of the hash (in bytes).
Returns:
The length of the hash.
Overrides:
hash_length in class MessageDigest
See Also:
HASH_LENGTH
 o data_length
  public final int data_length()
Return length of the data (in bytes) hashed in every transform.
Returns:
The length of the data block.
Overrides:
data_length in class MessageDigest
 o name
  public String name()
Return name of this hash function.
Returns:
The name of the hash function.
Overrides:
name in class MessageDigest
 o md_reset
  public void md_reset()
Initialise (reset) the message digest.
Overrides:
md_reset in class MessageDigest
 o md_transform
  protected void md_transform()
Add data to the message digest
Parameters:
data - The data to be added.
offset - The start of the data in the array.
length - The amount of data to add.
Overrides:
md_transform in class MessageDigest
 o java_transform
  protected void java_transform()
 o md_digest
  protected byte[] md_digest()
Returns the digest of the data added and resets the digest.
Returns:
the digest of all the data added to the message digest as a byte array.
Overrides:
md_digest in class MessageDigest
 o digestAsHash
  public MessageHash digestAsHash()
Returns the digest of the data added and resets the digest.
Returns:
the digest of all the data added to the message digest as an object.
Overrides:
digestAsHash in class MessageDigest
 o hash
  public static byte[] hash(String msg)
Returns the hash of a single string.
Parameters:
msg - the string to hash.
Returns:
the hash of the string.
 o hash
  public static byte[] hash(byte msg[])
Returns the hash of a single byte array.
Parameters:
msg - the byte array to hash.
Returns:
the hash of the string.
 o hashAsMessageHash
  public static HashMD5 hashAsMessageHash(String msg)
Returns the MessageHash of a single string.
Parameters:
msg - the string to hash.
Returns:
the MessageHash of the string.
 o hashAsMessageHash
  public static HashMD5 hashAsMessageHash(byte msg[])
Returns the MessageHash of a single byte array.
Parameters:
msg - the byte array to hash.
Returns:
the MessageHash of the byte array.
 o CreateHash
  public static HashMD5 CreateHash(byte hash[])
Returns the hash of a single byte array.
Parameters:
msg - the byte array to hash.
Returns:
the hash of the string.
 o F
  protected static int F(int x,
                         int y,
                         int z)
 o G
  protected static int G(int x,
                         int y,
                         int z)
 o H
  protected static int H(int x,
                         int y,
                         int z)
 o I
  protected static int I(int x,
                         int y,
                         int z)
 o FF
  protected static int FF(int a,
                          int b,
                          int c,
                          int d,
                          int k,
                          int s,
                          int t)
 o GG
  protected static int GG(int a,
                          int b,
                          int c,
                          int d,
                          int k,
                          int s,
                          int t)
 o HH
  protected static int HH(int a,
                          int b,
                          int c,
                          int d,
                          int k,
                          int s,
                          int t)
 o II
  protected static int II(int a,
                          int b,
                          int c,
                          int d,
                          int k,
                          int s,
                          int t)
 o transform
  protected void transform(int M[])
 o byte2int
  public final static void byte2int(int dst[],
                                    int dst_off,
                                    byte src[],
                                    int src_off,
                                    int len)
 o main
  public final static void main(String argv[]) throws IOException
 o self_test
  public static void self_test(PrintStream out,
                               String argv[]) throws Exception

All Packages  Class Hierarchy  This Package  Previous  Next  Index