Package org.cryptacular.bean
Interface CipherBean
- All Known Implementing Classes:
AbstractBlockCipherBean
,AbstractCipherBean
,AEADBlockCipherBean
,BufferedBlockCipherBean
public interface CipherBean
Bean that performs encryption/decryption using a symmetric cipher.
- Author:
- Middleware Services
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
decrypt
(byte[] input) Decrypts the input data using a block cipher.void
decrypt
(InputStream input, OutputStream output) Decrypts the data from the input stream onto the output stream using a symmetric cipher.byte[]
encrypt
(byte[] input) Encrypts the input data using a symmetric cipher.void
encrypt
(InputStream input, OutputStream output) Encrypts the data from the input stream onto the output stream using a symmetric cipher.
-
Method Details
-
encrypt
Encrypts the input data using a symmetric cipher.- Parameters:
input
- Plaintext data to encrypt.- Returns:
- Ciphertext output.
- Throws:
CryptoException
- on underlying cipher data handling errors.
-
encrypt
Encrypts the data from the input stream onto the output stream using a symmetric cipher.The caller is responsible for providing and managing the streams (e.g. closing them when finished).
- Parameters:
input
- Input stream containing plaintext data to encrypt.output
- Output stream containing ciphertext produced by cipher in encryption mode.- Throws:
CryptoException
- on underlying cipher data handling errors.StreamException
- on stream IO errors.
-
decrypt
Decrypts the input data using a block cipher.- Parameters:
input
- Ciphertext data to encrypt.- Returns:
- Plaintext output.
- Throws:
CryptoException
- on underlying cipher data handling errors.
-
decrypt
Decrypts the data from the input stream onto the output stream using a symmetric cipher.The caller is responsible for providing and managing the streams (e.g. closing them when finished).
- Parameters:
input
- Input stream containing ciphertext data to decrypt.output
- Output stream containing plaintext produced by cipher in decryption mode.- Throws:
CryptoException
- on underlying cipher data handling errors.StreamException
- on stream IO errors.
-