Package com.logicaldoc.util.crypt
Class CryptUtil
- java.lang.Object
-
- com.logicaldoc.util.crypt.CryptUtil
-
public class CryptUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCryptUtil.EncryptionException
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_ENCRYPTION_KEYstatic StringDES_ENCRYPTION_SCHEMEstatic StringDESEDE_ENCRYPTION_SCHEME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringcryptString(String original)This method encodes a given string using the SHA algorithmvoiddecrypt(File inputFile, File outputFile)Stringdecrypt(String encryptedString)voidencrypt(File inputFile, File outputFile)Stringencrypt(String unencryptedString)static StringgetHex(byte[] raw)static StringhashMD4(String original)Converts a string into a MD4 hash.static StringhashNTLM1(String original)Converts a string into a MD4 hash suitable for the NTLM v1 authentication
-
-
-
Field Detail
-
DESEDE_ENCRYPTION_SCHEME
public static final String DESEDE_ENCRYPTION_SCHEME
- See Also:
- Constant Field Values
-
DES_ENCRYPTION_SCHEME
public static final String DES_ENCRYPTION_SCHEME
- See Also:
- Constant Field Values
-
DEFAULT_ENCRYPTION_KEY
public static final String DEFAULT_ENCRYPTION_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CryptUtil
public CryptUtil(String encryptionKey) throws CryptUtil.EncryptionException
- Throws:
CryptUtil.EncryptionException
-
CryptUtil
public CryptUtil(String encryptionScheme, String encryptionKey) throws CryptUtil.EncryptionException
- Throws:
CryptUtil.EncryptionException
-
-
Method Detail
-
encrypt
public void encrypt(File inputFile, File outputFile) throws CryptUtil.EncryptionException
- Throws:
CryptUtil.EncryptionException
-
decrypt
public void decrypt(File inputFile, File outputFile) throws CryptUtil.EncryptionException
- Throws:
CryptUtil.EncryptionException
-
encrypt
public String encrypt(String unencryptedString) throws CryptUtil.EncryptionException
- Throws:
CryptUtil.EncryptionException
-
decrypt
public String decrypt(String encryptedString) throws CryptUtil.EncryptionException
- Throws:
CryptUtil.EncryptionException
-
cryptString
public static String cryptString(String original)
This method encodes a given string using the SHA algorithm- Parameters:
original- String to encode.- Returns:
- Encoded string.
-
hashMD4
public static String hashMD4(String original)
Converts a string into a MD4 hash.- Parameters:
original- the original string to be encrypted.- Returns:
- the returned hash as bytes.
-
hashNTLM1
public static String hashNTLM1(String original)
Converts a string into a MD4 hash suitable for the NTLM v1 authentication- Parameters:
original- the original string- Returns:
- the MD4 hash
-
getHex
public static String getHex(byte[] raw)
-
-