Public Member Functions | |
LSDCrypto () | |
void | setSecretKey (Key secretKey) |
void | setSecretKey (byte[] keyData) |
Cipher | toCrypt () |
Cipher | toDecrypt () |
Static Public Member Functions | |
static void | main (String[] args) throws Exception |
Protected Member Functions | |
Key | getSecretKey () |
Private Member Functions | |
byte[] | getSecretKeyInBytes () |
void | generateKey () throws NoSuchAlgorithmException |
byte[] | crypt (byte[] plaintext) throws IllegalBlockSizeException,BadPaddingException |
byte[] | crypt (String plaintext) throws Exception |
byte[] | decryptInBytes (byte[] ciphertext) throws IllegalBlockSizeException,BadPaddingException |
String | decryptInString (byte[] ciphertext) throws Exception |
Private Attributes | |
Key | secretKey = null |
openlsd.network.server.legacy.LSDCrypto.LSDCrypto | ( | ) |
Create a new LSDCrypto
Key openlsd.network.server.legacy.LSDCrypto.getSecretKey | ( | ) | [protected] |
Returns the secretKey
byte [] openlsd.network.server.legacy.LSDCrypto.getSecretKeyInBytes | ( | ) | [private] |
Returns all information about the key in an array of byte. Therefore this key can be stored and then rebuild later on using the setSecretKey(byte[] keyData) method.
void openlsd.network.server.legacy.LSDCrypto.setSecretKey | ( | Key | secretKey | ) |
void openlsd.network.server.legacy.LSDCrypto.setSecretKey | ( | byte[] | keyData | ) |
Allows to rebuild the secret Key with the data stored in the array of byte.
keyData |
void openlsd.network.server.legacy.LSDCrypto.generateKey | ( | ) | throws NoSuchAlgorithmException [private] |
Generate a new key according to the Blowfish algorithm.
NoSuchAlgorithmException |
byte [] openlsd.network.server.legacy.LSDCrypto.crypt | ( | byte[] | plaintext | ) | throws IllegalBlockSizeException,BadPaddingException [private] |
Crypt the array of bytes plaintext and returns the result in an array of byte or null if the cipher (key or algorithm) is incorrect..
plaintext |
IllegalBlockSizeException | if the encryption failed | |
BadPaddingException | if the encryption failed |
byte [] openlsd.network.server.legacy.LSDCrypto.crypt | ( | String | plaintext | ) | throws Exception [private] |
Crypt the String plaintext and returns the result in an array of byte or null if the cipher (key or algorithm) is incorrect..
plaintext |
Exception | if the encryption failed |
Cipher openlsd.network.server.legacy.LSDCrypto.toCrypt | ( | ) |
Returns a cipher for encryption associated with the key
Cipher openlsd.network.server.legacy.LSDCrypto.toDecrypt | ( | ) |
Returns a cipher for decryption associated with the key
byte [] openlsd.network.server.legacy.LSDCrypto.decryptInBytes | ( | byte[] | ciphertext | ) | throws IllegalBlockSizeException,BadPaddingException [private] |
Decrypt the array of byte ciphertext and returns the result in an array of byte or null if the cipher (key or algorithm) is incorrect.
ciphertext | the array of encrypted byte |
IllegalBlockSizeException | if the decryption failed | |
BadPaddingException | if the decryption failed |
String openlsd.network.server.legacy.LSDCrypto.decryptInString | ( | byte[] | ciphertext | ) | throws Exception [private] |
Decrypt the array of byte ciphertext and returns the result in a string or null if the cipher (key or algorithm) is incorrect..
ciphertext | the array of encrypted byte |
Exception | if the decryption failed |
static void openlsd.network.server.legacy.LSDCrypto.main | ( | String[] | args | ) | throws Exception [static] |
For testing purpose
args | is the text to crypt |
Exception |
Key openlsd.network.server.legacy.LSDCrypto.secretKey = null [private] |
Crypto Key