public class Crypto extends Object
| Constructor and Description |
|---|
Crypto() |
| Modifier and Type | Method and Description |
|---|---|
String |
decrypt(String encrytedText)
Decrypts an given encrypted text using the application secret property (application.secret) as key
|
String |
decrypt(String encrytedText,
String key)
Decrypts an given encrypted text using the given key
|
String |
encrypt(String plainText)
Encrypts a given plain text using the application secret property (application.secret) as key
Encryption is done by using AES and CBC Cipher and a key length of 128/192/256 bit depending on
the size of the application.secret property length (16/24/32 characters)
|
String |
encrypt(String plainText,
String key)
Encrypts a given plain text using the given key
Encryption is done by using AES and CBC Cipher and a key length of 128/192/256 bit depending on
the size of the application.secret property length (16/24/32 characters)
|
public String decrypt(String encrytedText)
encrytedText - The encrypted textpublic String decrypt(String encrytedText, String key)
encrytedText - The encrypted textkey - The encryption keypublic String encrypt(String plainText)
plainText - The plain text to encryptpublic String encrypt(String plainText, String key)
plainText - The plain text to encryptkey - The key to use for encryptionCopyright © 2016. All rights reserved.