Package edu.boisestate.lowry.crypto
Interface BlockCipher
- All Known Implementing Classes:
RC6Cipher
public interface BlockCipher
Defines a cryptographic block cipher. A BlockCipher operates on a
fixed-length block of data. BlockCipher is deterministic, that is
given the same key and block, it will produce the same output.
-
Method Details
-
encipher
Enciphers a fixed-length block of plaintext.- Parameters:
plaintext- A block of data with length equivalent to getBlockSize().key- The secret key for enciphering.- Returns:
- The resulting enciphered block.
- Throws:
IllegalArgumentException- If the input length does not match the block size.
-
decipher
Deciphers a fixed-length block of ciphertext.- Parameters:
ciphertext- A block of encrypted data with length equivalent to getBlockSize().key- The secret key for deciphering.- Returns:
- The resulting deciphered block.
- Throws:
IllegalArgumentException- If the input length does not match the block size.
-
getBlockSize
int getBlockSize()Returns the fixed block size this cipher operates on.- Returns:
- The block size in bytes.
-