All Packages Class Hierarchy This Package Previous Next Index
Class cryptix.security.SHA0
java.lang.Object
|
+----cryptix.security.MessageDigest
|
+----cryptix.security.SHA0
- public class SHA0
- extends MessageDigest
- implements Cloneable
Note: SHA0 is deprecated.
This class implements the Cryptix V2.2 API for the the SHA-0 message digest
algorithm (not to be confused with the revised SHA-1 algorithm). SHA-1
is preferred for new applications.
References:
- NIST FIPS PUB 180,
"Secure Hash Standard",
U.S. Department of Commerce, May 1993.
Copyright © 1995-1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.4 $
- Author:
- Systemics Ltd, David Hopwood
-
DATA_LENGTH
- Length of a block (the number of bytes hashed in every transform).
-
HASH_LENGTH
- Length of the final hash (in bytes).
-
SHA0()
- This creates an SHA-0 message digest instance.
-
CreateHash(byte[])
- Returns a HashSHA0 object whose value as a byte array is hash.
Deprecated.
-
hash(byte[])
- Returns the SHA-0 hash of a single byte array.
Deprecated.
-
hash(String)
- Returns the SHA-0 hash of a single string.
Deprecated.
-
hashAsMessageHash(byte[])
- Returns the MessageHash of a single byte array.
Deprecated.
-
hashAsMessageHash(String)
- Returns the MessageHash of a single string.
Deprecated.
-
main(String[])
-
-
self_test(PrintWriter)
-
HASH_LENGTH
public static final int HASH_LENGTH
- Length of the final hash (in bytes).
DATA_LENGTH
public static final int DATA_LENGTH
- Length of a block (the number of bytes hashed in every transform).
SHA0
public SHA0()
- This creates an SHA-0 message digest instance.
hash
public static byte[] hash(String str)
- Note: hash() is deprecated.
Use
MessageDigest.getInstance("SHA-0", "Cryptix").digest(cryptix.mime.LegacyString.toByteArray(str))
instead.
- Returns the SHA-0 hash of a single string.
- Parameters:
- str - the string to hash.
hash
public static byte[] hash(byte data[])
- Note: hash() is deprecated.
Use
MessageDigest.getInstance("SHA-0", "Cryptix").digest(data)
instead.
- Returns the SHA-0 hash of a single byte array.
- Parameters:
- msg - the byte array to hash.
hashAsMessageHash
public static HashSHA0 hashAsMessageHash(String str)
- Note: hashAsMessageHash() is deprecated.
Use
MessageHash.fromDigest(MessageDigest.getInstance("SHA-0", "Cryptix"),
cryptix.mime.LegacyString.toByteArray(str))
instead.
- Returns the MessageHash of a single string.
- Parameters:
- msg - the string to hash.
hashAsMessageHash
public static HashSHA0 hashAsMessageHash(byte data[])
- Note: hashAsMessageHash() is deprecated.
Use
MessageHash.fromDigest(MessageDigest.getInstance("SHA-0", "Cryptix"),
data)
instead.
- Returns the MessageHash of a single byte array.
- Parameters:
- data - the byte array to hash.
CreateHash
public static HashSHA0 CreateHash(byte hash[])
- Note: CreateHash() is deprecated.
Use
new MessageHash("SHA-0", hash)
instead.
- Returns a HashSHA0 object whose value as a byte array is hash.
main
public static void main(String args[])
self_test
public static void self_test(PrintWriter out) throws Exception
All Packages Class Hierarchy This Package Previous Next Index