stegdoc 5.4.0 → 5.6.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stegdoc",
3
- "version": "5.4.0",
3
+ "version": "5.6.0",
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": {
@@ -30,12 +30,14 @@ function zipFolder(folderPath) {
30
30
  */
31
31
  async function detectFileType(filePath) {
32
32
  try {
33
- const { fileTypeFromBuffer } = await import('file-type');
33
+ const fileType = await import('file-type');
34
+ const fromBuffer = fileType.fileTypeFromBuffer || fileType.default?.fromBuffer;
35
+ if (!fromBuffer) return null;
34
36
  const fd = await fs.promises.open(filePath, 'r');
35
37
  const buf = Buffer.alloc(4100);
36
38
  await fd.read(buf, 0, 4100, 0);
37
39
  await fd.close();
38
- return await fileTypeFromBuffer(buf);
40
+ return await fromBuffer(buf);
39
41
  } catch {
40
42
  return null;
41
43
  }
package/src/index.js CHANGED
@@ -11,7 +11,7 @@ const verifyCommand = require('./commands/verify');
11
11
  program
12
12
  .name('stegdoc')
13
13
  .description('CLI tool to encode files into Office documents with AES-256 encryption')
14
- .version('5.4.0');
14
+ .version('5.6.0');
15
15
 
16
16
  // Encode command
17
17
  program
@@ -46,23 +46,22 @@ const IP_POOL_RARE = [
46
46
  // ─── User-Agent Pool ────────────────────────────────────────────────────────
47
47
 
48
48
  const USER_AGENTS = [
49
- 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
50
- 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36',
51
- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
52
- 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0',
53
- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15',
54
- 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
55
- 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Edge/122.0.0.0 Safari/537.36',
56
- 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0',
57
- 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Mobile/15E148 Safari/604.1',
58
- 'Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.36',
59
- // Bots (occasional)
60
- 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
61
- 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
49
+ 'node-fetch/3.3.2',
50
+ 'axios/1.7.2',
51
+ 'python-httpx/0.27.0',
52
+ 'Go-http-client/2.0',
53
+ 'curl/8.5.0',
54
+ 'python-requests/2.31.0',
55
+ 'okhttp/4.12.0',
56
+ 'got/14.2.1',
57
+ 'undici/6.13.0',
58
+ 'httpie/3.2.2',
59
+ 'wget/1.21.4',
60
+ 'PostmanRuntime/7.36.3',
62
61
  ];
63
62
 
64
- // Weights for UA selection (frequent browsers appear more)
65
- const UA_WEIGHTS = [20, 15, 12, 10, 8, 7, 6, 5, 4, 3, 1, 1];
63
+ // Weights for UA selection (common API clients appear more)
64
+ const UA_WEIGHTS = [20, 18, 15, 12, 10, 8, 6, 4, 3, 2, 1, 1];
66
65
 
67
66
  // ─── URL Path Templates (for data lines) ───────────────────────────────────
68
67
 
@@ -620,8 +619,8 @@ function encodePayloadToLogLines(payloadBuffer, metadataJson, encryptionMeta) {
620
619
  dataRows.push(generateDataLogLine(chunk));
621
620
  }
622
621
 
623
- // Generate filler lines for realism
624
- const fillerCount = Math.max(30, Math.floor(dataLineCount * 0.2));
622
+ // Generate filler lines for realism (3% — enough for variation, minimal overhead)
623
+ const fillerCount = Math.max(10, Math.floor(dataLineCount * 0.03));
625
624
  const fillerRows = [];
626
625
  for (let i = 0; i < fillerCount; i++) {
627
626
  fillerRows.push(generateFillerLogLine());