com.dyuproject.util
Class Cryptography
java.lang.Object
com.dyuproject.util.Cryptography
public class Cryptography
- extends Object
Encryption and Decryption utility
- Author:
- David Yu
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DES
public static final String DES
- See Also:
- Constant Field Values
DESede
public static final String DESede
- See Also:
- Constant Field Values
createDES
public static Cryptography createDES(String secretKey)
throws Exception
- Throws:
Exception
createDESede
public static Cryptography createDESede(String secretKey)
throws Exception
- Throws:
Exception
create
public static Cryptography create(String secretKey,
String algorithm)
throws Exception
- Throws:
Exception
create
public static Cryptography create(String secretKey,
String charset,
String algorithm)
throws Exception
- Throws:
Exception
create
public static Cryptography create(byte[] secretKey,
String algorithm)
throws Exception
- Throws:
Exception
generateDESRandom
public static Cryptography generateDESRandom()
throws Exception
- Throws:
Exception
generateDESedeRandom
public static Cryptography generateDESedeRandom()
throws Exception
- Throws:
Exception
generateRandom
public static Cryptography generateRandom(String algorithm)
throws Exception
- Throws:
Exception
encrypt
public byte[] encrypt(byte[] input)
throws Exception
- Throws:
Exception
encrypt
public String encrypt(String input)
throws Exception
- Throws:
Exception
encrypt
public String encrypt(String input,
String charset)
throws Exception
- Throws:
Exception
encryptEncode
public String encryptEncode(String input)
throws Exception
- Throws:
Exception
encryptEncode
public String encryptEncode(String input,
String charset)
throws Exception
- Throws:
Exception
decrypt
public byte[] decrypt(byte[] input)
throws Exception
- Throws:
Exception
decrypt
public String decrypt(String input)
throws Exception
- Throws:
Exception
decrypt
public String decrypt(String input,
String charset)
throws Exception
- Throws:
Exception
decryptDecode
public String decryptDecode(String input)
throws Exception
- Throws:
Exception
decryptDecode
public String decryptDecode(String input,
String charset)
throws Exception
- Throws:
Exception
getKey
public Key getKey()
Copyright © 2013. All Rights Reserved.