Package gnu.crypto.hash

Provides a basic API for using message digest algorithms.

Interface Summary

IMessageDigest The basic visible methods of any hash algorithm.

A hash (or message digest) algorithm produces its output by iterating a basic compression function on blocks of data.

Class Summary

BaseHash A base abstract class to facilitate hash implementations.
HashFactory A Factory to instantiate message digest algorithm instances.
Haval The HAVAL message-digest algorithm is a variable output length, with variable number of rounds.
MD2 An implementation of the MD2 message digest algorithm.

MD2 is not widely used.

MD4 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.

MD5 The MD5 message-digest algorithm takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input.
RipeMD128 RIPEMD-128 is a 128-bit message digest.

References:

  1. RIPEMD160: A Strengthened Version of RIPEMD.
    Hans Dobbertin, Antoon Bosselaers and Bart Preneel.
RipeMD160 RIPEMD-160 is a 160-bit message digest.

References:

  1. RIPEMD160: A Strengthened Version of RIPEMD.
    Hans Dobbertin, Antoon Bosselaers and Bart Preneel.
Sha160 The Secure Hash Algorithm (SHA-1) is required for use with the Digital Signature Algorithm (DSA) as specified in the Digital Signature Standard (DSS) and whenever a secure hash algorithm is required for federal applications.
Sha256 Implementation of SHA2-1 [SHA-256] per the IETF Draft Specification.

References:

  1. Descriptions of SHA-256, SHA-384, and SHA-512,
  2. http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf
Sha384 Implementation of SHA2-2 [SHA-384] per the IETF Draft Specification.

References:

  1. Descriptions of SHA-256, SHA-384, and SHA-512,
  2. http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf
Sha512 Implementation of SHA2-3 [SHA-512] per the IETF Draft Specification.

References:

  1. Descriptions of SHA-256, SHA-384, and SHA-512,
  2. http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf
Tiger The Tiger message digest.
Whirlpool Whirlpool, a new 512-bit hashing function operating on messages less than 2 ** 256 bits in length.
Provides a basic API for using message digest algorithms.

Package overview

Message digests, or one-way hash functions, generate fixed-sized signatures from variable-sized texts, in such a way that it is computationally infeasible to determine the source text from the signature or to find a different text that hashes to the same signature.

The following diagram shows the important classes participating in this package:

../../../../diagrams/hash_class_diag.png" width=362 height=271 border=0>

Here is a simple example of how to use the SHA-1 hash.

IMessageDigest md = HashFactory.getInstance("SHA-1");
md.update(input, 0, input.length);
byte[] digest = md.digest();
<!-- $Revision: 1.4 $ -->

Copyright © 2001, 2002, 2003
Free Software Foundation, Inc. All Rights Reserved.