Package com.easydesk.crypto.provider
Class CleanCrypt
java.lang.Object
com.easydesk.crypto.provider.CleanCrypt
- All Implemented Interfaces:
CryptoAlgorithm
- Direct Known Subclasses:
AESCrypt,BlowfishCrypt,DigestCrypt,HmacCrypt,JavaCrypt
This is a dummy for "cleartext" encryption.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]byte[]decrypt(char[] value, byte[] salt, int iteration) byte[]encrypt(byte[] value, byte[] salt, int iteration) Performs the actual encryption.byte[]encrypt(char[] value, byte[] salt, int iteration) Performs the actual encryption.byte[]DOCUMENT ME!encrytedFullPassword(char[] text) (non-Javadoc)int(non-Javadoc)getKey(byte[] key) byte[]getRandom(int length) DOCUMENT ME!byte[]getSalt()DOCUMENT ME!booleanutility method to check is hex only string or notprotected booleanisValid(byte[] testHash, byte[] hash) DOCUMENT ME!boolean(non-Javadoc)booleanfor enc-dec mechanismvoidThis class never uses an algorithm, so this is just a dummy.voidsetKeyLength(int length) DOCUMENT ME!voidsetSaltSize(int salt_size) (non-Javadoc)voidThis class never uses a seed, so this is just a dummy.protected byte[]toBytes(char[] chars) DOCUMENT ME!protected char[]toChars(byte[] bytes) DOCUMENT ME!
-
Constructor Details
-
CleanCrypt
public CleanCrypt()Creates a new CleanCrypt object.
-
-
Method Details
-
setCipher
This class never uses an algorithm, so this is just a dummy.- Specified by:
setCipherin interfaceCryptoAlgorithm- Parameters:
cipher- Cipher (ignored)
-
setSeed
This class never uses a seed, so this is just a dummy.- Specified by:
setSeedin interfaceCryptoAlgorithm- Parameters:
seed- Seed (ignored)
-
setKeyLength
public void setKeyLength(int length) DOCUMENT ME!- Specified by:
setKeyLengthin interfaceCryptoAlgorithm- Parameters:
length- DOCUMENT ME!
-
setSaltSize
public void setSaltSize(int salt_size) (non-Javadoc)- Specified by:
setSaltSizein interfaceCryptoAlgorithm- Parameters:
salt_size-- See Also:
-
encrypt
Performs the actual encryption.- Specified by:
encryptin interfaceCryptoAlgorithm- Parameters:
value- The value to be encryptedsalt-iteration-- Returns:
- The encrypted value
- Throws:
GeneralSecurityException- various errors from the underlying ciphers.
-
encrypt
Performs the actual encryption.- Specified by:
encryptin interfaceCryptoAlgorithm- Parameters:
value- The value to be encryptedsalt-iteration-- Returns:
- The encrypted value
- Throws:
GeneralSecurityException- various errors from the underlying ciphers.
-
encrypt
DOCUMENT ME!- Specified by:
encryptin interfaceCryptoAlgorithm- Parameters:
value- DOCUMENT ME!key- DOCUMENT ME!- Returns:
- DOCUMENT ME!
- Throws:
GeneralSecurityException- DOCUMENT ME!
-
decrypt
- Specified by:
decryptin interfaceCryptoAlgorithm- Parameters:
value- the value to be decryptedkey- DOCUMENT ME!- Throws:
GeneralSecurityException
-
decrypt
- Specified by:
decryptin interfaceCryptoAlgorithm- Parameters:
value-salt-iteration-- Returns:
- Throws:
GeneralSecurityException
-
getKey
- Specified by:
getKeyin interfaceCryptoAlgorithm- Parameters:
key-
-
isValid
public boolean isValid(char[] test, String stored, char[] salt, int iterate) throws GeneralSecurityException Description copied from interface:CryptoAlgorithmfor enc-dec mechanism- Specified by:
isValidin interfaceCryptoAlgorithm- Parameters:
test- the value to be testedstored-salt-iterate-- Returns:
- Throws:
GeneralSecurityException
-
isValid
(non-Javadoc)- Specified by:
isValidin interfaceCryptoAlgorithm- Parameters:
test-stored-- Returns:
- Throws:
GeneralSecurityException- See Also:
-
encrytedFullPassword
(non-Javadoc)- Specified by:
encrytedFullPasswordin interfaceCryptoAlgorithm- Parameters:
text-- Returns:
- Throws:
GeneralSecurityException- See Also:
-
getSalt
DOCUMENT ME!- Specified by:
getSaltin interfaceCryptoAlgorithm- Returns:
- DOCUMENT ME!
- Throws:
NoSuchAlgorithmException- DOCUMENT ME!
-
getIteration
public int getIteration()(non-Javadoc)- Specified by:
getIterationin interfaceCryptoAlgorithm- Returns:
- int value for encryption iteration value
- See Also:
-
getRandom
DOCUMENT ME!- Specified by:
getRandomin interfaceCryptoAlgorithm- Parameters:
length-- Returns:
- DOCUMENT ME!
- Throws:
NoSuchAlgorithmException- DOCUMENT ME!
-
isValid
protected boolean isValid(byte[] testHash, byte[] hash) DOCUMENT ME!- Parameters:
testHash- DOCUMENT ME!hash- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
toBytes
protected byte[] toBytes(char[] chars) DOCUMENT ME!- Parameters:
chars- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
toChars
protected char[] toChars(byte[] bytes) DOCUMENT ME!- Parameters:
bytes- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
isHex
utility method to check is hex only string or not- Parameters:
string-
-