NikitolProject
3e96b1ed88
test(03-01): add 19 unit tests for crypto, compression, and format modules
...
- crypto: encrypt/decrypt roundtrip, empty data, size formula, HMAC compute/verify, SHA-256 known values
- compression: compress/decompress roundtrip, empty data, large data, should_compress heuristic
- format: header write/read roundtrip, TOC entry roundtrip (ASCII + Cyrillic + empty name), bad magic/version rejection, entry size calculation matching FORMAT.md worked example
- Update hex-literal to v1.1
2026-02-25 00:30:47 +03:00
NikitolProject
ce9012c5c5
feat(03-01): create library crate, update main.rs imports, add dev-dependencies
...
- Create src/lib.rs re-exporting all modules as public
- Update main.rs to use encrypted_archive:: imports instead of local mod declarations
- Add dev-dependencies: tempfile, assert_cmd, hex-literal, predicates
2026-02-25 00:29:01 +03:00
NikitolProject
be507070b6
feat(02-02): implement pack, unpack, and inspect archive commands
...
- pack: two-pass algorithm reads/hashes/compresses/encrypts files then writes header+TOC+data
- inspect: reads header and TOC, displays all metadata (sizes, offsets, IVs, HMACs, SHA-256)
- unpack: HMAC-first verification, AES-256-CBC decryption, optional gzip decompression, SHA-256 check
- CLI dispatch wired from main.rs to archive module
- Directory traversal protection: rejects filenames starting with / or containing ..
- Compression auto-detection: .apk/.zip/etc stored without gzip (flags=0x00 when no file compressed)
- Round-trip verified: pack+unpack produces byte-identical files
- HMAC tamper detection verified: flipped ciphertext byte triggers rejection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-25 00:03:28 +03:00
NikitolProject
6292b41159
feat(02-01): format types, crypto pipeline, and compression module
...
- Implement Header and TocEntry structs matching FORMAT.md byte layout
- Add write_header (40 bytes) and write_toc_entry (101+name_len bytes) serialization
- Add read_header, read_toc_entry, read_toc deserialization with validation
- Implement AES-256-CBC encrypt/decrypt with PKCS7 padding via cbc crate
- Add HMAC-SHA-256 compute/verify over IV||ciphertext (encrypt-then-MAC)
- Add SHA-256 hash for original file integrity
- Implement gzip compress/decompress with deterministic mtime(0)
- Add should_compress heuristic for known compressed file extensions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-24 23:58:08 +03:00
NikitolProject
c647f3a90e
feat(02-01): project scaffolding with Cargo, CLI skeleton, and key module
...
- Initialize Rust project with aes, cbc, hmac, sha2, flate2, clap, rand, anyhow dependencies
- Add clap derive CLI with pack/unpack/inspect subcommands
- Add hardcoded 32-byte AES-256 key constant
- Create stub modules for format, crypto, compression, archive
- All 7 source files in place, cargo build succeeds
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-24 23:56:09 +03:00