XCMS Toolkit

com.cms.crypto
Class DigestAlgorithmFactory

java.lang.Object
  extended by com.cms.crypto.DigestAlgorithmFactory

public class DigestAlgorithmFactory
extends java.lang.Object

Resolves ASN.1 message digest algorithm information object identifiers into Java Digest algorithms.

Currently supports the following digest algorithms:

SHA-1: The Secure Hash Algorithm, as defined in the Secure Hash Standard defined in NIST FIPS 180-1.

SHA-256, SHA-384, and SHA-512: New hash algorithms for which the draft Federal Information Processing Standard 180-2, Secure Hash Standard (SHS) is now available. SHA-256 is a 256-bit hash function intended to provide 128 bits of security against collision attacks, while SHA-512 is a 512-bit hash function intended to provide 256 bits of security. A 384-bit hash may be obtained by truncating the SHA-512 output.

Note that according to the NIST web site (http://www.nist.gov/sha) “Birthday” attacks against a hash make make n-bit AES and a 2^n-bit hash roughly equivalent:

 – 128-bit AES » SHA-256
 – 192-bit AES » SHA-384
 – 256-bit AES » SHA-512
 
Note also the following:
 – DSA now limited to 1024 bits
 – 128-bit AES roughly as strong as 3000 bit DSA
 – 1024 bit DSA roughly as strong as 160-bit SHA-1
 

Version:
1.00 - 2005/09/17
Author:
support@phillipgriffin.com

Method Summary
 java.security.MessageDigest createMessageDigest(DigestAlgorithmIdentifier id)
          Creates a message digest.
static DigestAlgorithmFactory getInstance()
          Create a new instance of DigestAlgorithmFactory and set the current instance to this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DigestAlgorithmFactory getInstance()
Create a new instance of DigestAlgorithmFactory and set the current instance to this object.

Returns:
a new DigestAlgorithmFactory

createMessageDigest

public java.security.MessageDigest createMessageDigest(DigestAlgorithmIdentifier id)
                                                throws java.security.NoSuchAlgorithmException
Creates a message digest.

Parameters:
id - a message digest (hash) algorithm identifier
Returns:
a new message digest instance for the given algorithm or null
Throws:
java.security.NoSuchAlgorithmException

XCMS Toolkit


Copyright © 2005-2006 GRIFFIN Consulting. All Rights Reserved.