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.
- package/README.md +77 -91
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,18 +5,22 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/stegdoc)
|
|
6
6
|
[](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
|
|
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**
|
|
13
|
-
- **AES-256-GCM Encryption**
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
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
|
|
44
|
+
stegdoc decode access_log_20260315_1200_A1B2_part1.xlsx -p mypassword
|
|
41
45
|
|
|
42
46
|
# View file info without decoding
|
|
43
|
-
stegdoc info
|
|
47
|
+
stegdoc info access_log_20260315_1200_A1B2_part1.xlsx
|
|
44
48
|
|
|
45
49
|
# Verify file integrity
|
|
46
|
-
stegdoc verify
|
|
50
|
+
stegdoc verify access_log_20260315_1200_A1B2_part1.xlsx -p mypassword
|
|
47
51
|
```
|
|
48
52
|
|
|
49
53
|
## Commands
|
|
50
54
|
|
|
51
|
-
### `encode`
|
|
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
|
|
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
|
-
#
|
|
72
|
-
stegdoc encode document.pdf
|
|
76
|
+
# Encode with password (produces access log spreadsheet)
|
|
77
|
+
stegdoc encode document.pdf -p mysecret
|
|
73
78
|
|
|
74
|
-
# Encode
|
|
75
|
-
stegdoc encode
|
|
79
|
+
# Encode as Hebrew incident report (DOCX)
|
|
80
|
+
stegdoc encode config.json -p mysecret -f docx
|
|
76
81
|
|
|
77
|
-
# Split into
|
|
78
|
-
stegdoc encode large-
|
|
82
|
+
# Split into 3 parts
|
|
83
|
+
stegdoc encode large-file.zip -p mysecret -s "3 parts"
|
|
79
84
|
|
|
80
|
-
#
|
|
81
|
-
stegdoc encode
|
|
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`
|
|
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
|
|
110
|
+
stegdoc decode access_log_20260315_1200_A1B2_part1.xlsx -p mysecret
|
|
107
111
|
|
|
108
|
-
# Decode
|
|
109
|
-
stegdoc decode
|
|
112
|
+
# Decode DOCX
|
|
113
|
+
stegdoc decode system_report_20260315_0800_CD42_part1.docx -p mysecret
|
|
110
114
|
|
|
111
|
-
# Multi-part files
|
|
112
|
-
stegdoc decode
|
|
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`
|
|
119
|
+
### `info` — View metadata without decoding
|
|
116
120
|
|
|
117
121
|
```bash
|
|
118
122
|
stegdoc info <file>
|
|
119
123
|
```
|
|
120
124
|
|
|
121
|
-
|
|
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> [
|
|
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
|
-
###
|
|
133
|
+
### v5 Pipeline (default)
|
|
147
134
|
|
|
148
135
|
```
|
|
149
136
|
Input File
|
|
150
|
-
|
|
151
|
-
[Compression]
|
|
152
|
-
|
|
153
|
-
[
|
|
154
|
-
|
|
155
|
-
[
|
|
156
|
-
|
|
157
|
-
[Office Wrapper]
|
|
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
|
-
###
|
|
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
|
|
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
|
|
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
|
|
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 (
|
|
181
|
-
- **Authentication**: 128-bit auth tag
|
|
173
|
+
- **IV**: 96 bits (randomly generated per part)
|
|
174
|
+
- **Salt**: 128 bits (shared per session)
|
|
175
|
+
- **Authentication**: 128-bit auth tag
|
|
182
176
|
|
|
183
|
-
###
|
|
177
|
+
### Filenames
|
|
184
178
|
|
|
185
|
-
Output files use deterministic, realistic filenames:
|
|
186
179
|
```
|
|
187
|
-
|
|
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
|
-
|
|
184
|
+
## Legacy Mode
|
|
192
185
|
|
|
193
|
-
|
|
186
|
+
Use `--legacy` to produce v4 format files (hidden sheet + gzip compression) for environments that haven't upgraded to stegdoc v5:
|
|
194
187
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
|
|
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
|
|
211
|
-
|
|
212
|
-
## Contributing
|
|
213
|
-
|
|
214
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
200
|
+
MIT License — see [LICENSE](LICENSE) for details.
|