cyberchef 9.43.0 → 9.44.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/CHANGELOG.md CHANGED
@@ -13,6 +13,9 @@ All major and minor version changes will be documented in this file. Details of
13
13
 
14
14
  ## Details
15
15
 
16
+ ### [9.43.0] - 2022-07-08
17
+ - Added 'ROT13 Brute Force' and 'ROT47 Brute Force' operations [@mikecat] | [#1264]
18
+
16
19
  ### [9.42.0] - 2022-07-08
17
20
  - Added 'LS47 Encrypt' and 'LS47 Decrypt' operations [@n1073645] | [#951]
18
21
 
@@ -303,6 +306,7 @@ All major and minor version changes will be documented in this file. Details of
303
306
 
304
307
 
305
308
 
309
+ [9.43.0]: https://github.com/gchq/CyberChef/releases/tag/v9.43.0
306
310
  [9.42.0]: https://github.com/gchq/CyberChef/releases/tag/v9.42.0
307
311
  [9.41.0]: https://github.com/gchq/CyberChef/releases/tag/v9.41.0
308
312
  [9.40.0]: https://github.com/gchq/CyberChef/releases/tag/v9.40.0
@@ -430,6 +434,7 @@ All major and minor version changes will be documented in this file. Details of
430
434
  [@t-8ch]: https://github.com/t-8ch
431
435
  [@hettysymes]: https://github.com/hettysymes
432
436
  [@swesven]: https://github.com/swesven
437
+ [@mikecat]: https://github.com/mikecat
433
438
 
434
439
  [8ad18b]: https://github.com/gchq/CyberChef/commit/8ad18bc7db6d9ff184ba3518686293a7685bf7b7
435
440
  [9a33498]: https://github.com/gchq/CyberChef/commit/9a33498fed26a8df9c9f35f39a78a174bf50a513
@@ -528,3 +533,5 @@ All major and minor version changes will be documented in this file. Details of
528
533
  [#1313]: https://github.com/gchq/CyberChef/pull/1313
529
534
  [#1326]: https://github.com/gchq/CyberChef/pull/1326
530
535
  [#1364]: https://github.com/gchq/CyberChef/pull/1364
536
+ [#1264]: https://github.com/gchq/CyberChef/pull/1264
537
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberchef",
3
- "version": "9.43.0",
3
+ "version": "9.44.0",
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",
@@ -133,6 +133,7 @@
133
133
  "lodash": "^4.17.21",
134
134
  "loglevel": "^1.8.0",
135
135
  "loglevel-message-prefix": "^3.0.0",
136
+ "lz-string": "^1.4.4",
136
137
  "markdown-it": "^13.0.1",
137
138
  "moment": "^2.29.3",
138
139
  "moment-timezone": "^0.5.34",
@@ -325,7 +325,9 @@
325
325
  "Bzip2 Decompress",
326
326
  "Bzip2 Compress",
327
327
  "Tar",
328
- "Untar"
328
+ "Untar",
329
+ "LZString Compress",
330
+ "LZString Decompress"
329
331
  ]
330
332
  },
331
333
  {
@@ -7981,6 +7981,46 @@
7981
7981
  }
7982
7982
  ]
7983
7983
  },
7984
+ "LZString Compress": {
7985
+ "module": "Compression",
7986
+ "description": "Compress the input with lz-string.",
7987
+ "infoURL": "https://pieroxy.net/blog/pages/lz-string/index.html",
7988
+ "inputType": "string",
7989
+ "outputType": "string",
7990
+ "flowControl": false,
7991
+ "manualBake": false,
7992
+ "args": [
7993
+ {
7994
+ "name": "Compression Format",
7995
+ "type": "option",
7996
+ "value": [
7997
+ "default",
7998
+ "UTF16",
7999
+ "Base64"
8000
+ ]
8001
+ }
8002
+ ]
8003
+ },
8004
+ "LZString Decompress": {
8005
+ "module": "Compression",
8006
+ "description": "Decompresses data that was compressed with lz-string.",
8007
+ "infoURL": "https://pieroxy.net/blog/pages/lz-string/index.html",
8008
+ "inputType": "string",
8009
+ "outputType": "string",
8010
+ "flowControl": false,
8011
+ "manualBake": false,
8012
+ "args": [
8013
+ {
8014
+ "name": "Compression Format",
8015
+ "type": "option",
8016
+ "value": [
8017
+ "default",
8018
+ "UTF16",
8019
+ "Base64"
8020
+ ]
8021
+ }
8022
+ ]
8023
+ },
7984
8024
  "Label": {
7985
8025
  "module": "Default",
7986
8026
  "description": "Provides a location for conditional and fixed jumps to redirect execution to.",
@@ -9,6 +9,8 @@ import Bzip2Compress from "../../operations/Bzip2Compress.mjs";
9
9
  import Bzip2Decompress from "../../operations/Bzip2Decompress.mjs";
10
10
  import Gunzip from "../../operations/Gunzip.mjs";
11
11
  import Gzip from "../../operations/Gzip.mjs";
12
+ import LZStringCompress from "../../operations/LZStringCompress.mjs";
13
+ import LZStringDecompress from "../../operations/LZStringDecompress.mjs";
12
14
  import RawDeflate from "../../operations/RawDeflate.mjs";
13
15
  import RawInflate from "../../operations/RawInflate.mjs";
14
16
  import Tar from "../../operations/Tar.mjs";
@@ -25,6 +27,8 @@ OpModules.Compression = {
25
27
  "Bzip2 Decompress": Bzip2Decompress,
26
28
  "Gunzip": Gunzip,
27
29
  "Gzip": Gzip,
30
+ "LZString Compress": LZStringCompress,
31
+ "LZString Decompress": LZStringDecompress,
28
32
  "Raw Deflate": RawDeflate,
29
33
  "Raw Inflate": RawInflate,
30
34
  "Tar": Tar,
@@ -0,0 +1,21 @@
1
+ /**
2
+ * lz-string exports.
3
+ *
4
+ * @author crespyl [peter@crespyl.net]
5
+ * @copyright Peter Jacobs 2021
6
+ * @license Apache-2.0
7
+ */
8
+
9
+ import LZString from "lz-string";
10
+
11
+ export const COMPRESSION_OUTPUT_FORMATS = ["default", "UTF16", "Base64"];
12
+ export const COMPRESSION_FUNCTIONS = {
13
+ "default": LZString.compress,
14
+ "UTF16": LZString.compressToUTF16,
15
+ "Base64": LZString.compressToBase64,
16
+ };
17
+ export const DECOMPRESSION_FUNCTIONS = {
18
+ "default": LZString.decompress,
19
+ "UTF16": LZString.decompressFromUTF16,
20
+ "Base64": LZString.decompressFromBase64,
21
+ };
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @author crespyl [peter@crespyl.net]
3
+ * @copyright Peter Jacobs 2021
4
+ * @license Apache-2.0
5
+ */
6
+
7
+ import Operation from "../Operation.mjs";
8
+ import OperationError from "../errors/OperationError.mjs";
9
+
10
+ import {COMPRESSION_OUTPUT_FORMATS, COMPRESSION_FUNCTIONS} from "../lib/LZString.mjs";
11
+
12
+ /**
13
+ * LZString Compress operation
14
+ */
15
+ class LZStringCompress extends Operation {
16
+
17
+ /**
18
+ * LZStringCompress constructor
19
+ */
20
+ constructor() {
21
+ super();
22
+
23
+ this.name = "LZString Compress";
24
+ this.module = "Compression";
25
+ this.description = "Compress the input with lz-string.";
26
+ this.infoURL = "https://pieroxy.net/blog/pages/lz-string/index.html";
27
+ this.inputType = "string";
28
+ this.outputType = "string";
29
+ this.args = [
30
+ {
31
+ name: "Compression Format",
32
+ type: "option",
33
+ defaultIndex: 0,
34
+ value: COMPRESSION_OUTPUT_FORMATS
35
+ }
36
+ ];
37
+ }
38
+
39
+ /**
40
+ * @param {string} input
41
+ * @param {Object[]} args
42
+ * @returns {string}
43
+ */
44
+ run(input, args) {
45
+ const compress = COMPRESSION_FUNCTIONS[args[0]];
46
+ if (compress) {
47
+ return compress(input);
48
+ } else {
49
+ throw new OperationError("Unable to find compression function");
50
+ }
51
+ }
52
+
53
+ }
54
+
55
+ export default LZStringCompress;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @author crespyl [peter@crespyl.net]
3
+ * @copyright Peter Jacobs 2021
4
+ * @license Apache-2.0
5
+ */
6
+
7
+ import Operation from "../Operation.mjs";
8
+ import OperationError from "../errors/OperationError.mjs";
9
+
10
+ import {COMPRESSION_OUTPUT_FORMATS, DECOMPRESSION_FUNCTIONS} from "../lib/LZString.mjs";
11
+
12
+ /**
13
+ * LZString Decompress operation
14
+ */
15
+ class LZStringDecompress extends Operation {
16
+
17
+ /**
18
+ * LZStringDecompress constructor
19
+ */
20
+ constructor() {
21
+ super();
22
+
23
+ this.name = "LZString Decompress";
24
+ this.module = "Compression";
25
+ this.description = "Decompresses data that was compressed with lz-string.";
26
+ this.infoURL = "https://pieroxy.net/blog/pages/lz-string/index.html";
27
+ this.inputType = "string";
28
+ this.outputType = "string";
29
+ this.args = [
30
+ {
31
+ name: "Compression Format",
32
+ type: "option",
33
+ defaultIndex: 0,
34
+ value: COMPRESSION_OUTPUT_FORMATS
35
+ }
36
+ ];
37
+ }
38
+
39
+ /**
40
+ * @param {string} input
41
+ * @param {Object[]} args
42
+ * @returns {string}
43
+ */
44
+ run(input, args) {
45
+ const decompress = DECOMPRESSION_FUNCTIONS[args[0]];
46
+ if (decompress) {
47
+ return decompress(input);
48
+ } else {
49
+ throw new OperationError("Unable to find decompression function");
50
+ }
51
+ }
52
+
53
+
54
+ }
55
+
56
+ export default LZStringDecompress;
@@ -194,6 +194,8 @@ import Jump from "./Jump.mjs";
194
194
  import Keccak from "./Keccak.mjs";
195
195
  import LS47Decrypt from "./LS47Decrypt.mjs";
196
196
  import LS47Encrypt from "./LS47Encrypt.mjs";
197
+ import LZStringCompress from "./LZStringCompress.mjs";
198
+ import LZStringDecompress from "./LZStringDecompress.mjs";
197
199
  import Label from "./Label.mjs";
198
200
  import Lorenz from "./Lorenz.mjs";
199
201
  import LuhnChecksum from "./LuhnChecksum.mjs";
@@ -574,6 +576,8 @@ export {
574
576
  Keccak,
575
577
  LS47Decrypt,
576
578
  LS47Encrypt,
579
+ LZStringCompress,
580
+ LZStringDecompress,
577
581
  Label,
578
582
  Lorenz,
579
583
  LuhnChecksum,
@@ -197,6 +197,8 @@ import {
197
197
  Keccak as core_Keccak,
198
198
  LS47Decrypt as core_LS47Decrypt,
199
199
  LS47Encrypt as core_LS47Encrypt,
200
+ LZStringCompress as core_LZStringCompress,
201
+ LZStringDecompress as core_LZStringDecompress,
200
202
  Lorenz as core_Lorenz,
201
203
  LuhnChecksum as core_LuhnChecksum,
202
204
  MD2 as core_MD2,
@@ -577,6 +579,8 @@ function generateChef() {
577
579
  "keccak": _wrap(core_Keccak),
578
580
  "LS47Decrypt": _wrap(core_LS47Decrypt),
579
581
  "LS47Encrypt": _wrap(core_LS47Encrypt),
582
+ "LZStringCompress": _wrap(core_LZStringCompress),
583
+ "LZStringDecompress": _wrap(core_LZStringDecompress),
580
584
  "lorenz": _wrap(core_Lorenz),
581
585
  "luhnChecksum": _wrap(core_LuhnChecksum),
582
586
  "MD2": _wrap(core_MD2),
@@ -972,6 +976,8 @@ const jump = chef.jump;
972
976
  const keccak = chef.keccak;
973
977
  const LS47Decrypt = chef.LS47Decrypt;
974
978
  const LS47Encrypt = chef.LS47Encrypt;
979
+ const LZStringCompress = chef.LZStringCompress;
980
+ const LZStringDecompress = chef.LZStringDecompress;
975
981
  const label = chef.label;
976
982
  const lorenz = chef.lorenz;
977
983
  const luhnChecksum = chef.luhnChecksum;
@@ -1354,6 +1360,8 @@ const operations = [
1354
1360
  keccak,
1355
1361
  LS47Decrypt,
1356
1362
  LS47Encrypt,
1363
+ LZStringCompress,
1364
+ LZStringDecompress,
1357
1365
  label,
1358
1366
  lorenz,
1359
1367
  luhnChecksum,
@@ -1740,6 +1748,8 @@ export {
1740
1748
  keccak,
1741
1749
  LS47Decrypt,
1742
1750
  LS47Encrypt,
1751
+ LZStringCompress,
1752
+ LZStringDecompress,
1743
1753
  label,
1744
1754
  lorenz,
1745
1755
  luhnChecksum,
@@ -118,6 +118,7 @@ import "./tests/ELFInfo.mjs";
118
118
  import "./tests/Subsection.mjs";
119
119
  import "./tests/CaesarBoxCipher.mjs";
120
120
  import "./tests/LS47.mjs";
121
+ import "./tests/LZString.mjs";
121
122
 
122
123
 
123
124
  // Cannot test operations that use the File type yet
@@ -0,0 +1,33 @@
1
+ /**
2
+ * LZString tests.
3
+ *
4
+ * @author crespyl [peter@crespyl.net]
5
+ * @copyright Peter Jacobs 2021
6
+ * @license Apache-2.0
7
+ */
8
+ import TestRegister from "../../lib/TestRegister.mjs";
9
+
10
+ TestRegister.addTests([
11
+ {
12
+ name: "LZString Compress To Base64",
13
+ input: "hello world",
14
+ expectedOutput: "BYUwNmD2AEDukCcwBMg=",
15
+ recipeConfig: [
16
+ {
17
+ "op": "LZString Compress",
18
+ "args": ["Base64"]
19
+ }
20
+ ],
21
+ },
22
+ {
23
+ name: "LZString Decompress From Base64",
24
+ input: "BYUwNmD2AEDukCcwBMg=",
25
+ expectedOutput: "hello world",
26
+ recipeConfig: [
27
+ {
28
+ "op": "LZString Decompress",
29
+ "args": ["Base64"]
30
+ }
31
+ ],
32
+ }
33
+ ]);