NikitolProject
7820c18622
feat(08-01): add directory support to pack/unpack/inspect
...
- Implement collect_entries() with recursive directory traversal (DFS preorder)
- pack() handles mixed file and directory arguments with relative paths
- Directory entries stored with entry_type=1, zero-length crypto fields
- unpack() creates directory hierarchy and restores Unix mode bits
- inspect() displays entry type (dir/file) and octal permissions
- Update cli.rs doc comments for directory support
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-26 21:47:15 +03:00
NikitolProject
4e25d19ff5
feat(08-01): update format.rs for v1.1 TOC entry layout
...
- Bump VERSION constant from 1 to 2
- Add entry_type (u8) and permissions (u16) fields to TocEntry struct
- Update write_toc_entry/read_toc_entry for new field order after name
- Update entry_size formula from 101 to 104 + name_length
- Update all unit tests for v1.1 layout (new fields, version 2, sizes)
- Add placeholder entry_type/permissions to archive.rs ProcessedFile for compilation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-26 21:45:20 +03:00
NikitolProject
b6fa51d9fd
feat(06-01): implement full obfuscation pipeline in archive.rs
...
- pack(): generate decoy padding (64-4096 random bytes per file)
- pack(): encrypt serialized TOC with AES-256-CBC using random toc_iv
- pack(): XOR header buffer before writing (8-byte cyclic key)
- pack(): set flags bits 1-3 (0x0E) for all obfuscation features
- unpack(): XOR bootstrapping via read_header_auto()
- unpack(): decrypt TOC when flags bit 1 is set
- inspect(): full de-obfuscation via shared read_archive_metadata()
- Factor out read_archive_metadata() helper for unpack/inspect reuse
- All existing tests pass (unit, golden, round-trip integration)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-25 02:19:48 +03:00
NikitolProject
8ac25125ab
feat(06-01): add XOR header obfuscation and buffer-based serialization to format.rs
...
- Add XOR_KEY constant (FORMAT.md Section 9.1)
- Add xor_header_buf() for cyclic 8-byte XOR encode/decode
- Add write_header_to_buf() for buffer-based header serialization
- Add read_header_auto() with XOR bootstrapping detection
- Add serialize_toc() and read_toc_from_buf() helpers for TOC encryption
- Add parse_header_from_buf() internal helper
- Add 6 new unit tests (XOR round-trip, magic change, auto-detect, buf helpers)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-25 02:17:59 +03:00
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