All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class utils.MD5

java.lang.Object
   |
   +----utils.MD5

public final class MD5
extends Object
Implementation of RSA's MD5 hash generator This code is loosely based on the RSA reference implementation and an early Java port of it by Santeri Paavolainen. Objects of this class are single use only -- clients must ensure that only one hash is computed, and sequentially too. Hashes are returned as an array of 16 bytes. Usage: byte[] hash = MD5.hash(bytes); [single pass mode] MD5 digest = new MD5(); [multiple pass mode] digest.update(bytes); digest.update(morebytes); byte[] hash = digest.hash();


Constructor Index

 o MD5()

Method Index

 o hash()
 o hash(byte[])
 o hash(byte[], int, int)
 o main(String[])
Runs RSA driver testsuite to check that the hash is correct
 o toString(byte[])
 o update(byte[])
 o update(byte[], int, int)
 o update(String)

Constructors

 o MD5
 public MD5()

Methods

 o update
 public void update(byte buf[],
                    int offset,
                    int length)
 o update
 public void update(byte buf[])
 o update
 public void update(String s)
 o hash
 public byte[] hash()
 o hash
 public static byte[] hash(byte buf[],
                           int off,
                           int len)
 o hash
 public static byte[] hash(byte buf[])
 o toString
 public static String toString(byte hash[])
 o main
 public static void main(String args[]) throws Exception
Runs RSA driver testsuite to check that the hash is correct


All Packages  Class Hierarchy  This Package  Previous  Next  Index