goldengate.common.crypto
Class Des
java.lang.Object
goldengate.common.crypto.KeyObject
goldengate.common.crypto.Des
public class Des
- extends KeyObject
This class handles methods to crypt and decrypt messages with DES algorithm (very efficient: 8600/s).
Usage:
- Create a Des object: Des key = new Des();
- Create a key:
- Generate: key.generateKey();
The method key.getSecretKeyInBytes() allow getting the key in Bytes.
- From an external source: key.setSecretKey(arrayOfBytes);
- To crypt a String in a Base64 format: String myStringCrypt = key.cryptToString(myString);
- To decrypt one string from Base64 format to the original String: String myStringDecrypt = key.decryptStringInString(myStringCrypte);
- Author:
- frederic bregier
|
Constructor Summary |
Des()
|
| Methods inherited from class goldengate.common.crypto.KeyObject |
crypt, crypt, cryptToHex, cryptToHex, decodeHex, decrypt, decryptHexFile, decryptHexInBytes, decryptHexInBytes, decryptHexInString, decryptInString, encodeHex, generateKey, getSecretKey, getSecretKeyInBytes, keyReady, saveSecretKey, setSecretKey, setSecretKey, setSecretKey, toCrypt, toDecrypt |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY_SIZE
public static final int KEY_SIZE
- This value could be between 32 and 128 due to license limitation.
- See Also:
- Constant Field Values
ALGO
public static final String ALGO
- See Also:
- Constant Field Values
INSTANCE
public static final String INSTANCE
- See Also:
- Constant Field Values
EXTENSION
public static final String EXTENSION
- See Also:
- Constant Field Values
Des
public Des()
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithm in class KeyObject
- Returns:
- the algorithm used (Java name)
getInstance
public String getInstance()
- Specified by:
getInstance in class KeyObject
- Returns:
- the instance used (Java name)
getKeySize
public int getKeySize()
- Specified by:
getKeySize in class KeyObject
- Returns:
- the size for the algorithm key
main
public static void main(String[] args)
throws Exception
- This method allows to test the correctness of this class
- Parameters:
args -
- Throws:
Exception
Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.