Package com.anlavn.hash
Class SHA
java.lang.Object
com.anlavn.hash.SHA
The SHA256 class only supports object encryption, decryption it is impossible.
SHA256 uses the Secure Hash Algorithm 2 cryptographic hash function designed by the US National Security Agency with a 256-bit long hash value.
Make sure your object class was "implements Serializable".
Make sure your object class was "implements Serializable".
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe SHA (Secure Hash Algorithm) Family designates a family of 8 different hash functions. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SHA
public SHA()
-
-
Method Details
-
Encrypt
Use this method to encrypt the original object.- Parameters:
type- is the type in SHA Family use to encrypt.objToEncrypt- is the object need encrypt.- Returns:
- a SHA256 hash code of the original object.
-
Encrypt
Use this method to encrypt the original string.- Parameters:
type- is the type in SHA Family use to encrypt.strToEncrypt- is the string need encrypt.- Returns:
- a SHA256 hash code of the original string.
-