stegdoc 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +77 -91
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,18 +5,22 @@
5
5
  [![npm version](https://img.shields.io/npm/v/stegdoc.svg)](https://www.npmjs.com/package/stegdoc)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
- **stegdoc** is a CLI tool that encodes any file into legitimate-looking Office documents (Excel/Word). Your data is hidden within spreadsheets or documents that appear to contain normal server monitoring reports, while optionally being protected with military-grade AES-256-GCM encryption.
8
+ **stegdoc** is a CLI tool that encodes any file into legitimate-looking Office documents (Excel/Word). Your data is hidden within realistic server access logs and Hebrew incident reports no hidden sheets, no suspicious content. Optionally protected with AES-256-GCM encryption.
9
9
 
10
10
  ## Features
11
11
 
12
- - **Steganography** - Hide data in Excel spreadsheets (hidden sheets) or Word documents
13
- - **AES-256-GCM Encryption** - Military-grade encryption with PBKDF2 key derivation (100k iterations)
14
- - **Realistic Decoy Data** - Generated server metrics that make files look like IT monitoring reports
15
- - **Multi-part Splitting** - Automatically split large files across multiple documents
16
- - **Smart Compression** - Gzip compression for compressible files, skipped for images/video/archives
17
- - **Integrity Verification** - SHA-256 hashing detects tampering
18
- - **Folder Support** - Encode entire directories (automatically zipped)
19
- - **Interactive Mode** - User-friendly prompts guide you through options
12
+ - **Log-Based Steganography** Payload is embedded directly in realistic nginx access log entries (URL tokens, UUIDs, trace IDs). No hidden sheets the data IS the logs
13
+ - **AES-256-GCM Encryption** Military-grade encryption with PBKDF2 key derivation (100k iterations)
14
+ - **Brotli Compression** — 15-25% better compression than gzip
15
+ - **Dual Format Support**
16
+ - **XLSX** Access log spreadsheet with realistic entries, any file size
17
+ - **DOCX** Hebrew RTL incident report with log excerpts, files under 1 MB
18
+ - **Multi-part Splitting** Automatically split large files across multiple documents
19
+ - **Integrity Verification** SHA-256 hashing detects tampering
20
+ - **Folder Support** — Encode entire directories (automatically zipped)
21
+ - **Interactive Mode** — User-friendly prompts guide you through options
22
+ - **Legacy Compatibility** — `--legacy` flag produces v4 format for older environments
23
+ - **Backward Compatible** — Reads and decodes all previous format versions
20
24
 
21
25
  ## Installation
22
26
 
@@ -37,30 +41,31 @@ npx stegdoc encode myfile.pdf
37
41
  stegdoc encode secret.pdf -p mypassword
38
42
 
39
43
  # Decode it back
40
- stegdoc decode server_metrics_20251215_1200_A1B2.xlsx -p mypassword
44
+ stegdoc decode access_log_20260315_1200_A1B2_part1.xlsx -p mypassword
41
45
 
42
46
  # View file info without decoding
43
- stegdoc info server_metrics_20251215_1200_A1B2.xlsx
47
+ stegdoc info access_log_20260315_1200_A1B2_part1.xlsx
44
48
 
45
49
  # Verify file integrity
46
- stegdoc verify server_metrics_20251215_1200_A1B2.xlsx -p mypassword
50
+ stegdoc verify access_log_20260315_1200_A1B2_part1.xlsx -p mypassword
47
51
  ```
48
52
 
49
53
  ## Commands
50
54
 
51
- ### `encode` - Hide a file in an Office document
55
+ ### `encode` Hide a file in an Office document
52
56
 
53
57
  ```bash
54
58
  stegdoc encode <file> [options]
55
59
  ```
56
60
 
57
- **Options:**
58
61
  | Option | Description | Default |
59
62
  |--------|-------------|---------|
60
63
  | `-o, --output-dir <dir>` | Output directory | Current directory |
61
- | `-s, --chunk-size <size>` | Split size: `5MB`, `25MB`, `3 parts`, `max`/`single`/`none` | `5MB` |
64
+ | `-s, --chunk-size <size>` | Split size: `5MB`, `25MB`, `3 parts`, `max` | `5MB` |
62
65
  | `-f, --format <format>` | Output format: `xlsx` or `docx` | `xlsx` |
63
66
  | `-p, --password <pass>` | Encryption password | None (unencrypted) |
67
+ | `--legacy` | Use v4 format for backward compatibility | Off |
68
+ | `--no-limit` | Bypass DOCX 1 MB size limit | Off |
64
69
  | `--force` | Overwrite existing files | Prompt |
65
70
  | `-q, --quiet` | Minimal output for scripting | Off |
66
71
  | `-y, --yes` | Skip interactive prompts | Off |
@@ -68,29 +73,28 @@ stegdoc encode <file> [options]
68
73
  **Examples:**
69
74
 
70
75
  ```bash
71
- # Basic encoding (will prompt for options)
72
- stegdoc encode document.pdf
76
+ # Encode with password (produces access log spreadsheet)
77
+ stegdoc encode document.pdf -p mysecret
73
78
 
74
- # Encode with password and Word format
75
- stegdoc encode document.pdf -p mysecret -f docx
79
+ # Encode as Hebrew incident report (DOCX)
80
+ stegdoc encode config.json -p mysecret -f docx
76
81
 
77
- # Split into exactly 3 parts
78
- stegdoc encode large-video.mp4 -p mysecret -s "3 parts"
82
+ # Split into 3 parts
83
+ stegdoc encode large-file.zip -p mysecret -s "3 parts"
79
84
 
80
- # No splitting (single file output)
81
- stegdoc encode archive.zip -p mysecret -s max
85
+ # Legacy v4 format (for older environments)
86
+ stegdoc encode data.bin -p mysecret --legacy
82
87
 
83
88
  # Encode a folder
84
89
  stegdoc encode ./my-folder -p mysecret
85
90
  ```
86
91
 
87
- ### `decode` - Recover the original file
92
+ ### `decode` Recover the original file
88
93
 
89
94
  ```bash
90
95
  stegdoc decode <file> [options]
91
96
  ```
92
97
 
93
- **Options:**
94
98
  | Option | Description | Default |
95
99
  |--------|-------------|---------|
96
100
  | `-o, --output <path>` | Output file path | Original filename |
@@ -103,103 +107,89 @@ stegdoc decode <file> [options]
103
107
 
104
108
  ```bash
105
109
  # Decode with password
106
- stegdoc decode server_metrics_20251215_1200_A1B2.xlsx -p mysecret
110
+ stegdoc decode access_log_20260315_1200_A1B2_part1.xlsx -p mysecret
107
111
 
108
- # Decode to specific location
109
- stegdoc decode report.xlsx -p mysecret -o ./recovered/original.pdf
112
+ # Decode DOCX
113
+ stegdoc decode system_report_20260315_0800_CD42_part1.docx -p mysecret
110
114
 
111
- # Multi-part files are auto-detected
112
- stegdoc decode server_metrics_20251215_1200_A1B2_part1.xlsx -p mysecret
115
+ # Multi-part files auto-detected (just provide part 1)
116
+ stegdoc decode access_log_20260315_1200_A1B2_part1.xlsx -p mysecret
113
117
  ```
114
118
 
115
- ### `info` - View metadata without decoding
119
+ ### `info` View metadata without decoding
116
120
 
117
121
  ```bash
118
122
  stegdoc info <file>
119
123
  ```
120
124
 
121
- Displays:
122
- - Original filename and size
123
- - Encryption status
124
- - Compression status
125
- - Part information (for split files)
126
- - Content hash for verification
127
-
128
- ### `verify` - Validate file integrity
125
+ ### `verify` — Validate file integrity
129
126
 
130
127
  ```bash
131
- stegdoc verify <file> [options]
128
+ stegdoc verify <file> [-p <password>]
132
129
  ```
133
130
 
134
- **Options:**
135
- | Option | Description |
136
- |--------|-------------|
137
- | `-p, --password <pass>` | Verify password is correct |
138
-
139
- Checks:
140
- - Metadata integrity
141
- - All parts present (for multi-part files)
142
- - Password validity (if provided)
143
-
144
131
  ## How It Works
145
132
 
146
- ### Encoding Pipeline
133
+ ### v5 Pipeline (default)
147
134
 
148
135
  ```
149
136
  Input File
150
-
151
- [Compression] → gzip (if beneficial)
152
-
153
- [Base64 Encoding]
154
-
155
- [Encryption] AES-256-GCM (optional)
156
-
157
- [Office Wrapper] XLSX or DOCX
158
-
159
- [Decoy Layer] → Server metrics data
160
-
137
+ |
138
+ [Brotli Compression]
139
+ |
140
+ [AES-256-GCM Encryption] (optional)
141
+ |
142
+ [Log-Embed Encoding] -- payload distributed across log line fields
143
+ |
144
+ [Office Wrapper] -- XLSX access logs or DOCX incident report
145
+ |
161
146
  Output File(s)
162
147
  ```
163
148
 
164
- ### File Storage
149
+ ### Data Channels (per log line)
150
+
151
+ Each nginx access log entry carries **114 bytes** of payload across 6 channels:
152
+
153
+ | Channel | Format | Bytes |
154
+ |---------|--------|-------|
155
+ | URL path segment | base64url | 21 |
156
+ | Query param `token` | base64url | 21 |
157
+ | Query param `state` | base64url | 21 |
158
+ | Referer `ref` param | base64url | 21 |
159
+ | X-Request-ID | UUID v4 (hex) | 14 |
160
+ | X-Trace-ID | 32-char hex | 16 |
161
+
162
+ ### Output Formats
165
163
 
166
- **XLSX Format:**
167
- - Sheet 1 ("Server Metrics"): Visible decoy data - looks like IT monitoring reports
168
- - Sheet 2 ("Data"): Hidden sheet containing your encrypted payload
164
+ **XLSX** — Single "Access Logs" sheet with realistic nginx log entries. Columns: Remote Address, Timestamp, Method, Request, Status, Bytes, Referer, User-Agent, X-Request-ID, X-Trace-ID. No hidden sheets.
169
165
 
170
- **DOCX Format:**
171
- - Embedded text with metadata and payload
172
- - Appears as a system report document
166
+ **DOCX** — Hebrew RTL incident report with title, executive summary, timeline table, log excerpts in monospace code blocks, root cause analysis, and recommendations. Reports are procedurally generated (15 services x 12 incident types = thousands of unique variants).
173
167
 
174
- ### Encryption Details
168
+ ### Encryption
175
169
 
176
170
  - **Algorithm**: AES-256-GCM (Galois/Counter Mode)
177
171
  - **Key Derivation**: PBKDF2-SHA256 with 100,000 iterations
178
172
  - **Key Size**: 256 bits
179
- - **IV**: 96 bits (randomly generated)
180
- - **Salt**: 128 bits (randomly generated)
181
- - **Authentication**: 128-bit auth tag (GCM provides authenticated encryption)
173
+ - **IV**: 96 bits (randomly generated per part)
174
+ - **Salt**: 128 bits (shared per session)
175
+ - **Authentication**: 128-bit auth tag
182
176
 
183
- ### Filename Generation
177
+ ### Filenames
184
178
 
185
- Output files use deterministic, realistic filenames:
186
179
  ```
187
- server_metrics_YYYYMMDD_HH00_XXXX.xlsx
188
- system_report_YYYYMMDD_HH00_XXXX.docx
180
+ access_log_YYYYMMDD_HH00_XXXX[_partN].xlsx
181
+ system_report_YYYYMMDD_HH00_XXXX[_partN].docx
189
182
  ```
190
183
 
191
- The date/time and ID are derived from a hash, ensuring files from the same encoding session are related.
184
+ ## Legacy Mode
192
185
 
193
- ## Use Cases
186
+ Use `--legacy` to produce v4 format files (hidden sheet + gzip compression) for environments that haven't upgraded to stegdoc v5:
194
187
 
195
- - **Secure file transfer** - Send encrypted files that look like mundane reports
196
- - **Backup storage** - Store sensitive data in plain sight
197
- - **Privacy** - Keep personal files private on shared systems
198
- - **Data portability** - Office documents work everywhere
199
-
200
- ## Backward Compatibility
188
+ ```bash
189
+ stegdoc encode data.bin -p mypass --legacy
190
+ ```
201
191
 
202
- Files created with previous versions are fully supported. The tool automatically detects and handles legacy formats.
192
+ The decoder auto-detects format version it reads both v4 and v5 files without any flags.
203
193
 
204
194
  ## Requirements
205
195
 
@@ -207,8 +197,4 @@ Files created with previous versions are fully supported. The tool automatically
207
197
 
208
198
  ## License
209
199
 
210
- MIT License - see [LICENSE](LICENSE) for details.
211
-
212
- ## Contributing
213
-
214
- Contributions are welcome! Please feel free to submit a Pull Request.
200
+ MIT License see [LICENSE](LICENSE) for details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stegdoc",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Hide files inside Office documents (XLSX/DOCX) with AES-256 encryption and steganography",
5
5
  "main": "src/index.js",
6
6
  "bin": {