cyberchef 9.50.0 → 9.50.2

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": "cyberchef",
3
- "version": "9.50.0",
3
+ "version": "9.50.2",
4
4
  "description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
5
5
  "author": "n1474335 <n1474335@gmail.com>",
6
6
  "homepage": "https://gchq.github.io/CyberChef",
@@ -136,7 +136,7 @@ const getFeature = function() {
136
136
 
137
137
  fs.writeFileSync(path.join(process.cwd(), "CHANGELOG.md"), changelogData);
138
138
 
139
- console.log("Written CHANGELOG.md");
139
+ console.log("Written CHANGELOG.md\nCommit changes and then run `npm version minor`.");
140
140
  }
141
141
  });
142
142
  };
@@ -105,13 +105,17 @@ export function fromHex(data, delim="Auto", byteLen=2) {
105
105
  throw new OperationError("Byte length must be a positive integer");
106
106
 
107
107
  if (delim !== "None") {
108
- const delimRegex = delim === "Auto" ? /[^a-f\d]|(0x)/gi : Utils.regexRep(delim);
109
- data = data.replace(delimRegex, "");
108
+ const delimRegex = delim === "Auto" ? /[^a-f\d]|0x/gi : Utils.regexRep(delim);
109
+ data = data.split(delimRegex);
110
+ } else {
111
+ data = [data];
110
112
  }
111
113
 
112
114
  const output = [];
113
- for (let i = 0; i < data.length; i += byteLen) {
114
- output.push(parseInt(data.substr(i, byteLen), 16));
115
+ for (let i = 0; i < data.length; i++) {
116
+ for (let j = 0; j < data[i].length; j += byteLen) {
117
+ output.push(parseInt(data[i].substr(j, byteLen), 16));
118
+ }
115
119
  }
116
120
  return output;
117
121
  }
@@ -45,7 +45,7 @@ class ParseASN1HexString extends Operation {
45
45
  */
46
46
  run(input, args) {
47
47
  const [index, truncateLen] = args;
48
- return r.ASN1HEX.dump(input.replace(/\s/g, ""), {
48
+ return r.ASN1HEX.dump(input.replace(/\s/g, "").toLowerCase(), {
49
49
  "ommitLongOctet": truncateLen
50
50
  }, index);
51
51
  }
@@ -59,7 +59,7 @@ class ParseX509Certificate extends Operation {
59
59
 
60
60
  switch (inputFormat) {
61
61
  case "DER Hex":
62
- input = input.replace(/\s/g, "");
62
+ input = input.replace(/\s/g, "").toLowerCase();
63
63
  cert.readCertHex(input);
64
64
  break;
65
65
  case "PEM":
@@ -45,10 +45,10 @@ TestRegister.addApiTests([
45
45
  const result = chef.ADD("sample input", {
46
46
  key: {
47
47
  string: "some key",
48
- option: "Hex"
48
+ option: "utf8"
49
49
  }
50
50
  });
51
- assert.equal(result.toString(), "aO[^ZS\u000eW\\^cb");
51
+ assert.equal(result.toString(), "\xe6\xd0\xda\xd5\x8c\xd0\x85\xe2\xe1\xdf\xe2\xd9");
52
52
  }),
53
53
 
54
54
 
@@ -121,10 +121,10 @@ Tiger-128`;
121
121
  const result = chef.AND("Scot-free", {
122
122
  key: {
123
123
  string: "Raining Cats and Dogs",
124
- option: "Hex",
124
+ option: "utf8",
125
125
  }
126
126
  });
127
- assert.strictEqual(result.toString(), "\u0000\"M$(D E");
127
+ assert.strictEqual(result.toString(), "Raid)fb A");
128
128
  }),
129
129
 
130
130
  it("atBash Cipher", () => {
@@ -371,10 +371,10 @@ color: white;
371
371
  },
372
372
  salt: {
373
373
  string: "Market",
374
- option: "Hex",
374
+ option: "utf8",
375
375
  },
376
376
  });
377
- assert.strictEqual(result.toString(), "7c21a9f5063a4d62fb1050068245c181");
377
+ assert.strictEqual(result.toString(), "4930d5d200e80f18c96b5550d13c6af8");
378
378
  }),
379
379
 
380
380
  it("Derive PBKDF2 Key", () => {