Commit Graph

88 Commits

Author SHA1 Message Date
NikitolProject
9fdeafbbd7 feat(kotlin): add --key, --key-file, --password support to ArchiveDecoder
Some checks failed
CI / test (push) Failing after 40s
Remove hardcoded KEY constant and accept key via CLI arguments.
Add Argon2id KDF (Bouncy Castle) with parameters matching Rust impl,
salt reading for password-derived archives, and hex/key-file parsing.
2026-02-27 02:11:20 +03:00
NikitolProject
f5772df07f docs(phase-12): complete phase execution 2026-02-27 00:07:13 +03:00
NikitolProject
83a8ec7e8e docs(12-02): complete password-based key derivation plan
- Add 12-02-SUMMARY.md with execution results
- Update STATE.md: Phase 12 complete, 15/15 plans done
- Update ROADMAP.md: Phase 12 progress to complete
- Mark KEY-03, KEY-04, KEY-05, KEY-06 requirements complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 00:03:33 +03:00
NikitolProject
4077847caa feat(12-02): wire salt into pack/unpack, update main.rs, add password tests
- Pack signature accepts optional salt, writes 16-byte salt between header and TOC
- Set flags bit 4 and adjust toc_offset to 56 when salt present
- read_archive_metadata returns salt alongside header and TOC entries
- Add read_archive_salt() public helper for pre-unpack salt reading
- main.rs uses resolve_key_for_pack/resolve_key_for_unpack for two-phase password flow
- Add 5 new integration tests: password roundtrip, wrong password rejection,
  salt flag presence, no-salt flag for key archives, directory password roundtrip
- All 52 tests pass (25 unit + 7 golden + 20 integration)
2026-02-27 00:01:23 +03:00
NikitolProject
035879b7e6 feat(12-02): implement Argon2id KDF, rpassword prompt, and salt format support
- Add argon2 0.5 and rpassword 7.4 dependencies
- Implement derive_key_from_password() using Argon2id with 16-byte salt
- Implement prompt_password() with optional confirmation for pack
- Add resolve_key_for_pack() (generates random salt) and resolve_key_for_unpack() (reads salt from archive)
- Add FLAG_KDF_SALT (bit 4), SALT_SIZE constant, read_salt/write_salt functions to format.rs
- Relax flags validation to allow bit 4 (bits 5-7 must be zero)
2026-02-26 23:58:38 +03:00
NikitolProject
df09325534 docs(12-01): complete CLI key input plan
- SUMMARY.md with execution results and decisions
- STATE.md updated with position, metrics, decisions
- ROADMAP.md updated with phase 12 progress
- REQUIREMENTS.md: KEY-01, KEY-02, KEY-07 marked complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 23:55:23 +03:00
NikitolProject
551e49994d test(12-01): update all tests for explicit key args, add key input tests
- Replace KEY import in golden.rs with local constant
- Replace KEY import in crypto.rs tests with local TEST_KEY constant
- Add --key to all CLI round-trip tests via cmd_with_key() helper
- Add test_key_file_roundtrip: pack/unpack with --key-file
- Add test_rejects_wrong_key: wrong key causes decryption failure
- Add test_rejects_bad_hex: too-short hex produces clear error
- Add test_rejects_missing_key: pack without key arg fails
- Add test_inspect_without_key: shows header only, not TOC
- Add test_inspect_with_key: shows full entry listing
- All 47 tests pass (25 unit + 7 golden + 15 integration)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 23:53:24 +03:00
NikitolProject
acff31b0f8 feat(12-01): add CLI key args and refactor archive functions for user-specified keys
- Add hex dependency for --key hex decoding
- Add KeyArgs (--key, --key-file, --password) as clap arg group on top-level CLI
- Replace hardcoded KEY constant with resolve_key() supporting hex and file sources
- Refactor pack/unpack to require key parameter, inspect accepts optional key
- Wire CLI key resolution to archive functions in main.rs
- Inspect works without key (header only) or with key (full TOC listing)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 23:50:39 +03:00
NikitolProject
2a049095d6 fix(12): revise plans based on checker feedback 2026-02-26 23:41:20 +03:00
NikitolProject
04081028ca docs(12-user-key-input): create phase plan 2026-02-26 23:36:50 +03:00
NikitolProject
52ff9ec3b7 perf: parallelize pack and unpack with rayon
Some checks failed
CI / test (push) Failing after 40s
Pack changes:
- Split into path-collection (sequential) + crypto-processing (parallel)
- Introduce CollectedEntry enum to separate directory walk from file processing
- process_file() now creates thread-local RNG instead of taking &mut Rng
- File entries processed via rayon into_par_iter(), preserving deterministic order

Unpack changes:
- Phase 1: Sequential read of all ciphertexts from archive (single file handle)
- Phase 2: Create all directories sequentially (parent-before-child ordering)
- Phase 3: Parallel verify/decrypt/decompress/write via rayon par_iter
- Phase 4: Sequential result reporting for deterministic output
- Collect results into Vec<UnpackResult> to avoid interleaved stdout/stderr
2026-02-26 23:07:04 +03:00
NikitolProject
0d8ab49a4d build: add rayon dependency for parallel processing
- Add rayon 1.11 to Cargo.toml dependencies
2026-02-26 22:57:39 +03:00
NikitolProject
8bc28d8121 docs(phase-09): complete phase execution 2026-02-26 22:10:01 +03:00
NikitolProject
1906235ac3 docs(09-01): complete Kotlin decoder update plan
- Summary: v1.1 Kotlin decoder with directory support and permission restoration
- STATE.md: Phase 9 complete, 13 plans total
- ROADMAP.md: Phase 09 progress updated
- REQUIREMENTS.md: KOT-05, KOT-06, KOT-07 marked complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 22:07:19 +03:00
NikitolProject
27fb3926cf test(09-01): add directory test cases to Kotlin cross-validation script
- Test 6: nested directory extraction (3+ levels deep, 4 files)
- Test 7: empty directory creation without decryption errors
- Test 8: mixed standalone files + directory pack/unpack
- All 5 original test cases preserved unchanged

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 22:05:29 +03:00
NikitolProject
a01b260944 feat(09-01): update Kotlin decoder for v1.1 format with directory support
- Add entryType and permissions fields to TocEntry data class
- Parse entry_type (1 byte) and permissions (2 bytes LE) in parseTocEntry
- Update version check from 1 to 2 for v1.1 format
- Handle directory entries: create dirs without decryption
- Create parent directories for files with relative paths
- Add applyPermissions() using Java File API (owner vs everyone)
- Update entry size formula comment to 104 + name_length

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 22:04:54 +03:00
NikitolProject
e905269bb5 docs(09-kotlin-decoder-update): create phase plan 2026-02-26 22:00:27 +03:00
NikitolProject
487c9001ce docs(phase-08): complete phase execution
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:54:15 +03:00
NikitolProject
2b470685e8 docs(08-01): complete Rust directory archiver plan
- Create 08-01-SUMMARY.md with execution results and metrics
- Update STATE.md: Phase 8 complete, 12/~19 plans (63%)
- Update ROADMAP.md: Phase 8 marked complete
- Update REQUIREMENTS.md: DIR-01 through DIR-05 marked complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:50:32 +03:00
NikitolProject
8760981717 test(08-01): add directory round-trip integration tests
- test_roundtrip_directory: full directory tree with permissions verification
- test_roundtrip_mixed_files_and_dirs: mixed file + directory pack/unpack
- test_inspect_shows_directory_info: inspect output contains dir/file types and permissions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:48:20 +03:00
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
7be915ff47 docs(08-rust-directory-archiver): create phase plan 2026-02-26 21:37:49 +03:00
NikitolProject
51e5b40045 docs(phase-07): complete phase execution 2026-02-26 21:32:27 +03:00
NikitolProject
034a6939f1 docs(07-01): complete format spec update plan
- SUMMARY.md with execution metrics and self-check
- STATE.md updated: Phase 7 complete, progress 58%
- ROADMAP.md: Phase 7 marked complete (1/1 plans)
- REQUIREMENTS.md: FMT-09, FMT-10, FMT-11, FMT-12 marked complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:28:15 +03:00
NikitolProject
37f7dd1f83 feat(07-01): replace worked example with v1.1 directory archive
- New worked example: 3 entries (2 dirs + 1 file) totaling 427 bytes
- Demonstrates nested dir (project/src), file (project/src/main.rs), empty dir (project/empty)
- Entry hex tables show entry_type and permissions fields
- Directory entries have all-zero crypto fields (iv, hmac, sha256, sizes)
- File entry shows full crypto pipeline with real SHA-256 hash
- Archive layout table with verified offsets (header=40, TOC=355, data=32)
- Complete annotated hex dump covers all 427 bytes
- Shell decode walkthrough handles directory entries (mkdir -p + chmod)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:25:55 +03:00
NikitolProject
e7535da7ce feat(07-01): update TOC entry definition with entry_type, permissions, and path semantics
- Add entry_type (u8) and permissions (u16 LE) fields to TOC entry
- Add Entry Type Values table (0x00=file, 0x01=directory)
- Add Permission Bits Layout table (POSIX mode_t lower 12 bits)
- Add Entry Name Semantics subsection (relative paths, parent-before-child)
- Update entry size formula: 101 -> 104 + name_length
- Bump format version from 1 to 2
- Rename file_count to entry_count in header
- Update Decode Order of Operations for directory handling
- Update Version Compatibility Rules for v2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:21:13 +03:00
NikitolProject
a7c3e009c9 docs(07-format-spec-update): create phase plan 2026-02-26 21:13:34 +03:00
NikitolProject
a716d09178 docs: create milestone v1.1 roadmap (5 phases) 2026-02-25 04:10:09 +03:00
NikitolProject
d787e05794 docs: define milestone v1.1 requirements 2026-02-25 04:05:10 +03:00
NikitolProject
c336022fb9 docs: start milestone v1.1 Directory Support 2026-02-25 03:56:18 +03:00
NikitolProject
d876f42b5c wip: milestone v1.0 completion paused — all phases done, archival pending 2026-02-25 03:49:42 +03:00
NikitolProject
7c24ae8558 feat: Delete depth with gitea.com in CI
Some checks failed
CI / test (push) Successful in 42s
Release / Build and release (push) Failing after 1m40s
v1.0.0
2026-02-25 03:32:28 +03:00
NikitolProject
b9ed446deb feat: Change CI logic
Some checks failed
CI / test (push) Successful in 41s
Release / Build and release (push) Has been cancelled
2026-02-25 03:19:16 +03:00
NikitolProject
96048f31f2 clean: Delete unused .jar file
All checks were successful
CI / test (push) Successful in 40s
2026-02-25 03:12:51 +03:00
NikitolProject
8920e8be24 feat: add CI with gitea workflows
Some checks failed
CI / test (push) Successful in 1m22s
Release / Build aarch64-unknown-linux-musl (push) Has been cancelled
Release / Build x86_64-pc-windows-gnu (push) Has been cancelled
Release / Package decoders (push) Has been cancelled
Release / Create release (push) Has been cancelled
Release / Build x86_64-unknown-linux-musl (push) Has been cancelled
2026-02-25 02:59:34 +03:00
NikitolProject
e0605b2955 docs: Add README files & etc 2026-02-25 02:50:47 +03:00
NikitolProject
b04b7b1c2c docs(phase-6): complete phase execution 2026-02-25 02:36:57 +03:00
NikitolProject
02dd009905 docs(06-02): complete Kotlin and Shell decoder obfuscation support plan
- Create 06-02-SUMMARY.md with execution results
- Update STATE.md: phase 6 complete, 100% progress, new decisions
- Update ROADMAP.md: phase 6 plans marked complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 02:29:05 +03:00
NikitolProject
ac51cc70aa feat(06-02): add XOR header bootstrapping and encrypted TOC support to Shell decoder
- Add XOR_KEY_HEX constant and hex_to_bin() helper (xxd + od fallback)
- Replace magic check with XOR bootstrapping: read 40 bytes, XOR if mismatch
- Write de-XORed header to temp file for field parsing
- Add TOC decryption via openssl enc when flags bit 1 is set
- Switch TOC parsing loop from $ARCHIVE to $TOC_FILE variable
- Update HMAC verification to construct IV from parsed hex (not archive position)
- All 7 cross-validation tests pass (Rust pack -> Shell decode -> SHA-256 match)
2026-02-25 02:26:05 +03:00
NikitolProject
cef681fd13 feat(06-02): add XOR header bootstrapping and encrypted TOC support to Kotlin decoder
- Add XOR_KEY constant matching FORMAT.md Section 9.1
- Add xorHeader() function with signed byte masking (and 0xFF)
- Update decode() with XOR bootstrapping: check magic, XOR if mismatch
- Update decode() with TOC decryption: decrypt when flags bit 1 is set
- Backward compatible: plain headers and unencrypted TOC still work
2026-02-25 02:24:25 +03:00
NikitolProject
4eaedc2872 docs(06-01): complete Rust obfuscation pipeline plan
- Add 06-01-SUMMARY.md with execution results
- Update STATE.md: phase 6, plan 1/2, 90% progress
- Update ROADMAP.md: phase 06 plan progress 1/2
- Mark FMT-06, FMT-07, FMT-08 complete in REQUIREMENTS.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 02:21:52 +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
0cd76d7a32 docs(06-obfuscation-hardening): create phase plan 2026-02-25 02:12:16 +03:00
NikitolProject
361f9bfb6b docs(06): research phase domain 2026-02-25 02:08:11 +03:00
NikitolProject
b6ef40d826 docs(phase-5): complete phase execution 2026-02-25 01:50:55 +03:00
NikitolProject
230f447711 docs(05-02): complete shell decoder cross-validation tests plan
- SUMMARY.md: 6/6 tests pass (single, multi, no-compress, empty, large, Cyrillic)
- STATE.md: Phase 5 complete, 8 plans total, 80% progress
- ROADMAP.md: Phase 5 marked complete (2/2 plans)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 01:46:27 +03:00
NikitolProject
e9d7442ead test(05-02): add cross-validation test script for shell decoder
- 6 test cases: single text, multiple files, no-compress, empty, large file, Cyrillic filename
- Uses Rust archiver to create archives, sh decode.sh to extract, SHA-256 to verify
- Follows same pattern as kotlin/test_decoder.sh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 01:43:58 +03:00
NikitolProject
ac169c286c docs(05-01): complete shell decoder plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 01:41:57 +03:00