Commit Graph

79 Commits

Author SHA1 Message Date
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
830c457b2a
feat(aes): Implement transform_impl with encryption and decryption rounds
- Implements core `transform_impl` handling both Encrypt and Decrypt actions.
- Implements 10-round AES encryption (standard rounds + final round).
- Implements 10-round AES decryption (inverse rounds + final inverse round).
- Adds `add_round_key` helper to XOR state with subkey block.
2025-11-24 08:50:22 +02:00
fc3eadcf3b
feat(aes): Implement InvShiftRows and InvMixColumns transformations
- Implements `inv_shift_rows` performing cyclic right shifts on state rows.
- Implements `inv_mix_columns` using inverse Galois Field matrix multiplication.
- Adds unit tests verifying inverse transformations are true inverses.
2025-11-24 08:50:22 +02:00
70a0e183b5
feat(aes): Implement ShiftRows and MixColumns transformations
- Implements `shift_rows` performing cyclic shifts on the state matrix rows.
- Implements `mix_columns` using Galois Field matrix multiplication.
- Adds `gmul` and `xtime` const helpers for GF(2^8) arithmetic.
- Adds unit tests verifying transformations against FIPS-197 vectors.
2025-11-24 08:50:22 +02:00
3de3440f16
feat(aes): add inverse SBox lookup 2025-11-24 08:50:22 +02:00
b2c5209214
feat(aes): add substitute bytes 2025-11-24 08:50:22 +02:00
7e5162fb44
feat(aes): add round key 2025-11-24 08:50:22 +02:00
4007a9a04d
fix: clippy warnings 2025-11-24 08:50:22 +02:00
bf6ae712a7
feat(aes): generate subkeys 2025-11-24 08:50:22 +02:00