Commit Graph

87 Commits

Author SHA1 Message Date
6acf98bbae
chore: update readme 2025-12-31 05:54:29 +02:00
721c712ba3
feat(web): add AES-CBC page with file encryption and UI improvements 2025-12-31 05:45:42 +02:00
651651780f
feat(web): add AES-CBC page with file encryption support 2025-12-31 05:39:45 +02:00
c208ce2e81
feat(web): create AES-CBC page
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
2025-12-31 05:29:11 +02:00
187b65d011
fix(web): update CipherContext call to include IV parameter 2025-12-31 05:05:47 +02:00
48ab599d66
feat(cli): add file encryption/decryption support
Add --input-file/-i and --output-file/-o options:
    - Encrypt files with AES-CBC: reads binary, writes binary/hex
    - Decrypt files with AES-CBC: reads binary, writes binary
    - Falls back to text-based processing for non-file operations
2025-12-31 04:24:51 +02:00
ae33c596ef
test(aes): add AES-CBC NIST SP 800-38A test vectors
Add integration tests for AES-CBC mode:
    - Single block encrypt/decrypt with NIST vectors
    - Multi-block encrypt with NIST vectors
    - Multi-block roundtrip verification
    - Empty plaintext handling
    - Arbitrary length plaintext
2025-12-31 04:12:20 +02:00
1ffc0327b3
feat(cipher-factory,cli): add CBC mode support to CipherContext and CLI
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
2025-12-31 01:09:00 +02:00
6c5cd9b78a
feat(cipher-factory): add AesCbc algorithm variant
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
2025-12-31 01:01:47 +02:00
454d1d6011
feat(aes): add AES-CBC mode implementation
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)
2025-12-31 00:58:49 +02:00
dd691cfa18
feat(cipher-core): add PKCS#7 padding support
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
2025-12-31 00:48:49 +02:00
f4480ba218
feat(aes): add IV (Initialization Vector) type for CBC mode
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
2025-12-31 00:45:26 +02:00
220baa09ad
docs(cipher-factory): document public API types
Add doc comments to OutputFormat, OperationMode enums and their methods.
Add crate-level documentation describing the factory's purpose.
2025-12-31 00:26:31 +02:00
dd07a1d29b
docs(aes,des): add crate documentation and improve re-exports
Add crate-level doc comments with usage examples. Export additional
types for library users:
    - aes: Block32 (32-bit word type)
    - des: LR (Feistel round state)
2025-12-31 00:18:24 +02:00
54b3d8716d
docs(des): document Feistel network and cipher operations
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.
2025-12-31 00:16:14 +02:00
9e013352a5
docs(aes): document cipher operation functions
Add doc comments explaining the four AES round operations:
    - SubBytes: S-box substitution for non-linearity
    - ShiftRows: cyclic row shifting for column diffusion
    - MixColumns: GF(2^8) matrix multiplication for row diffusion
    - AddRoundKey: XOR with derived subkey
2025-12-31 00:13:51 +02:00
2f41a0b773
docs(cipher-core): add documentation to public traits
Document BlockCipher, InputBlock, and BlockParser with usage examples
and method descriptions. Fix incorrect error message in decrypt() that
referenced "plaintext" instead of "ciphertext".
2025-12-31 00:09:26 +02:00
aacb836e77
refactor(cipher-core): unify secret_block! and secret_key! macros
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
2025-12-31 00:07:26 +02:00
451986d702
refactor(cipher-core): extract shared block parsing logic
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
2025-12-31 00:07:24 +02:00
656e112d9f
chore(aes): remove unused function 2025-12-30 23:48:38 +02:00
c3f39cedc9
fix(web): type-erase component views to fix compiler recursion limit 2025-12-30 15:38:58 +02:00
02ab1d119c
feat(web): add prefix hints 2025-12-30 14:46:26 +02:00
63271c50f8
feat(web): add ciphertext input constraints 2025-12-30 14:38:10 +02:00
0687fe0431
fix: clippy warnings 2025-12-18 18:42:50 +02:00
9869036bdf
fix(aes): From matrix Key 2025-12-18 18:24:30 +02:00
045f49a9ef
feat(web): add persistent theme 2025-11-26 19:17:25 +02:00
01eac0bc85
feat(web): save theme to localStorage 2025-11-26 18:59:55 +02:00
3dc7187910
feat(web): add 404 page 2025-11-26 18:44:21 +02:00
a04abffe45
chore(web): update favicon 2025-11-26 18:30:36 +02:00
024079af36
feat(web): improve homepage 2025-11-26 18:25:42 +02:00
898d5f7195
feat(web): add footer 2025-11-26 17:33:10 +02:00
a93ff3f920
chore(web): format files 2025-11-26 17:27:18 +02:00
f1a0ab75c3
fix: clippy warnings 2025-11-26 06:42:29 +02:00
b81b87e6db
fix: des guide 2025-11-26 06:26:04 +02:00
187d25d538
chore: add readme 2025-11-26 06:23:46 +02:00
5a892e6367
chore: remove .env 2025-11-26 06:00:17 +02:00
ce3a09088f
feat(web): add Dockerfile 2025-11-26 05:49:24 +02:00
bb7ef246f8
refactor(web): make smaller components 2025-11-26 05:07:02 +02:00
486f8957eb
feat(web): add output format option scroll 2025-11-26 04:44:36 +02:00
8431a9b876
feat(web): add copy button 2025-11-26 04:33:58 +02:00
aa4bd9ecec
feat(web): create CipherForm component 2025-11-26 03:43:23 +02:00
5f22690ef7
feat: add CipherContext struct 2025-11-26 01:38:11 +02:00
2254ecaf7c
feat(web): add simple webpage 2025-11-26 01:11:19 +02:00
46a47102b9
feat(factory): add cipher/algorithm helper functions 2025-11-24 12:02:22 +02:00
051bba33a8
feat(cli): add AES to cli app 2025-11-24 11:23:37 +02:00
5b3ca7eacf
test(aes): add 100 roundtrip integration tests 2025-11-24 11:01:02 +02:00
a8ccd3d294
refactor(aes): operate on custom values 2025-11-24 10:48:27 +02:00
37f8a97a11
refactor(aes): move to operations module 2025-11-24 08:50:22 +02:00
505cc8b08e
feat(aes): Add SubkeyChunks and SubkeyChunksRev iterators to Subkeys
- 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.
2025-11-24 08:50:22 +02:00
dae5b69966
feat(aes): Add missing transformation methods to Block128 2025-11-24 08:50:22 +02:00