Package edu.boisestate.lowry.crypto
Interface SymmetricCipher
- All Known Implementing Classes:
CTRMode
public interface SymmetricCipher
Defines a symmetric-key encryption/decryption scheme. A SymmetricCipher is
a high-level implementation of a mode of operation that uses an underlying
BlockCipher. Implementations of this interface are expected to handle
arbitrary-length inputs.
-
Method Summary
-
Method Details
-
encrypt
Encrypts the provided plaintext using a symmetric key.- Parameters:
plaintext- The data to be encrypted.key- The secret key for encryption.- Returns:
- The resulting ciphertext.
- Throws:
IllegalArgumentException- If the key length is invalid for the underlying cipher.
-
decrypt
Decrypts the provided ciphertext using a symmetric key.- Parameters:
ciphertext- The encrypted data to be decrypted.key- The secret key for decryption.- Returns:
- The resulting plaintext.
- Throws:
IllegalArgumentException- If the key length is invalid for the underlying cipher.
-