roxify 1.6.7 → 1.6.8

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/dist/cli.js CHANGED
@@ -80,6 +80,23 @@ Options:
80
80
  --debug Export debug images (doubled.png, reconstructed.png)
81
81
  -v, --verbose Show detailed errors
82
82
 
83
+ Lossy-Resilient Encoding:
84
+ --lossy-resilient Enable lossy-resilient mode (survives JPEG/MP3)
85
+ --ecc-level <level> ECC redundancy: low|medium|quartile|high (default: medium)
86
+ --block-size <n> Robust image block size: 2-8 pixels (default: 4)
87
+
88
+ When --lossy-resilient is active, data is encoded with Reed-Solomon ECC
89
+ and rendered as a QR-code-style grid (image) or MFSK tones (audio).
90
+ Use --sound or --image to choose the container format.
91
+
92
+ Examples:
93
+ npx rox encode secret.pdf Encode to PNG
94
+ npx rox encode secret.pdf --sound Encode to WAV
95
+ npx rox encode secret.pdf --lossy-resilient Lossy-resilient PNG
96
+ npx rox encode secret.pdf --lossy-resilient --sound --ecc-level high
97
+ npx rox decode secret.pdf.png Decode back
98
+ npx rox decode secret.pdf.wav Decode WAV back
99
+
83
100
  Run "npx rox help" for this message.
84
101
  `);
85
102
  }
@@ -118,6 +135,28 @@ function parseArgs(args) {
118
135
  parsed.forceTs = true;
119
136
  i++;
120
137
  }
138
+ else if (key === 'lossy-resilient') {
139
+ parsed.lossyResilient = true;
140
+ i++;
141
+ }
142
+ else if (key === 'ecc-level') {
143
+ const lvl = args[i + 1];
144
+ if (!['low', 'medium', 'quartile', 'high'].includes(lvl)) {
145
+ console.error(`Invalid --ecc-level: ${lvl}. Must be low|medium|quartile|high`);
146
+ process.exit(1);
147
+ }
148
+ parsed.eccLevel = lvl;
149
+ i += 2;
150
+ }
151
+ else if (key === 'block-size') {
152
+ const bs = parseInt(args[i + 1], 10);
153
+ if (isNaN(bs) || bs < 2 || bs > 8) {
154
+ console.error(`Invalid --block-size: ${args[i + 1]}. Must be 2-8`);
155
+ process.exit(1);
156
+ }
157
+ parsed.blockSize = bs;
158
+ i += 2;
159
+ }
121
160
  else if (key === 'sound') {
122
161
  parsed.container = 'sound';
123
162
  i++;
@@ -360,6 +399,13 @@ async function encodeCommand(args) {
360
399
  options.passphrase = parsed.passphrase;
361
400
  options.encrypt = parsed.encrypt || 'aes';
362
401
  }
402
+ if (parsed.lossyResilient) {
403
+ options.lossyResilient = true;
404
+ if (parsed.eccLevel)
405
+ options.eccLevel = parsed.eccLevel;
406
+ if (parsed.blockSize)
407
+ options.robustBlockSize = parsed.blockSize;
408
+ }
363
409
  console.log(`Encoding to ${resolvedOutput} (Mode: ${mode}, Container: ${containerMode === 'sound' ? 'WAV' : 'PNG'})\n`);
364
410
  let inputData;
365
411
  let inputSizeVal = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roxify",
3
- "version": "1.6.7",
3
+ "version": "1.6.8",
4
4
  "type": "module",
5
5
  "description": "Ultra-lightweight PNG steganography with native Rust acceleration. Encode binary data into PNG images with zstd compression.",
6
6
  "main": "dist/index.js",
Binary file