The AES-CBC page supports:
- Text input: Large textarea for typing/pasting plaintext or ciphertext
- File input: File upload for binary encryption/decryption
- IV input: Hex-based 16-byte initialization vector
- Download: Download encrypted/decrypted output as a file
- Output formats: Hex, Binary, Octal, Text for decryption output
Update CipherContext:
- Add optional iv field for CBC mode
- Add process_cbc() for CBC-specific handling
- Add parse_hex() helper for decryption input
- Separate ECB and CBC processing paths
Update CLI:
- Add --iv argument for initialization vector
- Pass IV through to CipherContext
Add AES-CBC support to Algorithm enum:
- Add AesCbc variant with clap name "aes-cbc"
- Add requires_iv() method to check if algorithm needs IV
- Add new_cbc_cipher() for creating AesCbc instances
- Add encrypt_cbc() and decrypt_cbc() helper methods
- Update parse_text() and Display for AesCbc
Add AesCbc struct with:
- CBC mode encryption with PKCS#7 padding
- CBC mode decryption with padding validation
- XOR chaining with IV for first block
- Expose encrypt_block/decrypt_block as pub(crate)
Add pkcs7_pad and pkcs7_unpad functions for block cipher modes:
- Pad data to block size multiples with N bytes of value N
- Validate and remove padding on decryption
- Add InvalidPadding variant to CipherError
Add 128-bit IV type using secret_block! macro with:
- Parsing from hex/binary/ASCII strings
- Conversions to/from Block128 for XOR operations
- Big-endian byte array conversions
Add doc comments to LR struct and DES helper functions explaining the
Feistel network structure: IP -> 16 rounds -> FP, with each round using
expansion, S-box substitution, and P-box permutation.
Document BlockCipher, InputBlock, and BlockParser with usage examples
and method descriptions. Fix incorrect error message in decrypt() that
referenced "plaintext" instead of "ciphertext".
Move duplicated macro definitions from aes and des crates into
cipher-core for shared use. Both macros now:
- Support u8 through u128 integer types
- Include Zeroize derive for secure memory handling
- Generate consistent formatting and conversion methods
Add generic BlockInt trait and parse_block_int<T>() function to
cipher-core, eliminating duplicate parsing code in aes and des crates.
- BlockInt trait abstracts over u64/u128 integer types
- Supports hex (0x), binary (0b), and ASCII string formats
- Improved BlockError::InvalidByteStringLength with max/actual fields
- Implements `chunks()` returning iterator over 4-element subkey arrays.
- Implements `chunks_rev()` returning reverse iterator for decryption.
- Enables cipher rounds to iterate over round keys sequentially and in reverse.