Package eirb.pub.app.utils
Class Cipher
java.lang.Object
eirb.pub.app.utils.Cipher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]decryptAESCBC(byte[] cipher, Key key, InitializationVector iv) Decryption with AES CBCstatic byte[]decryptAESECB(byte[] cipher, Key key) Decryption with AES ECBstatic byte[]decryptRSAECB(byte[] cipher, Key key) static byte[]encryptAESCBC(byte[] plain, Key key, InitializationVector iv) Encryption with AES CBCstatic byte[]encryptAESECB(byte[] plain, Key key) Encryption with AES ECBstatic byte[]encryptRSAECB(byte[] plain, Key key)
-
Constructor Details
-
Cipher
public Cipher()
-
-
Method Details
-
encryptAESCBC
public static byte[] encryptAESCBC(byte[] plain, Key key, InitializationVector iv) throws CipherException Encryption with AES CBC- Parameters:
plain- byte to encryptkey- Key to use for encryptioniv- Initialization vector to use for CBC- Returns:
- encrypted bytes
- Throws:
CipherException- if the encryption process failed
-
decryptAESCBC
public static byte[] decryptAESCBC(byte[] cipher, Key key, InitializationVector iv) throws CipherException Decryption with AES CBC- Parameters:
cipher- byte to decryptkey- Key to use for decryptioniv- Initialization vector to use for CBC- Returns:
- decrypted bytes
- Throws:
CipherException- if the decryption process failed
-
encryptAESECB
Encryption with AES ECB- Parameters:
plain- byte to encryptkey- Key to use for encryption- Returns:
- encrypted bytes
- Throws:
CipherException- if the encryption process failed
-
decryptAESECB
Decryption with AES ECB- Parameters:
cipher- byte to decryptkey- Key to use for decryption- Returns:
- decrypted bytes
- Throws:
CipherException- if the decryption process failed
-
encryptRSAECB
- Throws:
CipherException
-
decryptRSAECB
- Throws:
CipherException
-