public class Encryption
extends java.lang.Object
| Constructor and Description |
|---|
Encryption() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
decrypt(java.lang.String toDecrypt,
java.security.Key key)
Decrypt a string using a strong aes algorithm.
|
java.lang.String |
encrypt(java.lang.String toEncrypt,
java.security.Key key)
Encrypt a string using a strong aes algorithm.
|
java.security.Key |
generateKey()
Generate a unique key to use as the basis for some encryption.
|
public java.lang.String encrypt(java.lang.String toEncrypt,
java.security.Key key)
throws java.lang.Exception
toEncrypt - the string to encrypt.key - the encryption key.java.lang.Exception - any error.public java.lang.String decrypt(java.lang.String toDecrypt,
java.security.Key key)
throws java.lang.Exception
toDecrypt - the string to decrypt.key - the encryption key.java.lang.Exception - any error.public java.security.Key generateKey()
throws java.lang.Exception
java.lang.Exception - any error.