Package com.easydesk.crypto.provider
Class DigestCrypt
java.lang.Object
com.easydesk.crypto.provider.CleanCrypt
com.easydesk.crypto.provider.DigestCrypt
- All Implemented Interfaces:
CryptoAlgorithm
Implements the normal java.security.MessageDigest stream cipers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encrypt(byte[] value, byte[] salt, int iteration) encrypt the supplied string with the requested cipherbyte[]encrypt(char[] value, byte[] salt, int iteration) encrypt the supplied string with the requested cipherboolean(non-Javadoc)voidSetting the actual cipher requested.Methods inherited from class com.easydesk.crypto.provider.CleanCrypt
decrypt, decrypt, encrypt, encrytedFullPassword, getIteration, getKey, getRandom, getSalt, isHex, isValid, isValid, setKeyLength, setSaltSize, setSeed, toBytes, toChars
-
Constructor Details
-
DigestCrypt
public DigestCrypt()Creates a new DigestCrypt object.
-
-
Method Details
-
setCipher
Setting the actual cipher requested. If not called, then the default cipher (SHA-512) is used.- Specified by:
setCipherin interfaceCryptoAlgorithm- Overrides:
setCipherin classCleanCrypt- Parameters:
cipher- The cipher to use.
-
encrypt
encrypt the supplied string with the requested cipher- Specified by:
encryptin interfaceCryptoAlgorithm- Overrides:
encryptin classCleanCrypt- Parameters:
value- The value to be encryptedsalt- can not be nulliteration- ignored- Returns:
- The encrypted value
- Throws:
Exception- An Exception of the underlying implementation.GeneralSecurityException- various errors from the underlying ciphers.
-
encrypt
encrypt the supplied string with the requested cipher- Specified by:
encryptin interfaceCryptoAlgorithm- Overrides:
encryptin classCleanCrypt- Parameters:
value- The value to be encryptedsalt- can not be nulliteration- ignored- Returns:
- The encrypted value
- Throws:
Exception- An Exception of the underlying implementation.GeneralSecurityException- various errors from the underlying ciphers.
-
isValid
Description copied from class:CleanCrypt(non-Javadoc)- Specified by:
isValidin interfaceCryptoAlgorithm- Overrides:
isValidin classCleanCrypt- Parameters:
test- the value to be testedstored- salt + ":" + digested- Returns:
- Throws:
GeneralSecurityException- See Also:
-