cyberchef 9.40.0 → 9.41.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.40.0] - 2022-07-08
17
+ - Added 'P-list Viewer' operation [@n1073645] | [#906]
18
+
16
19
  ### [9.39.0] - 2022-06-09
17
20
  - Added 'ELF Info' operation [@n1073645] | [#1364]
18
21
 
@@ -294,6 +297,7 @@ All major and minor version changes will be documented in this file. Details of
294
297
 
295
298
 
296
299
 
300
+ [9.40.0]: https://github.com/gchq/CyberChef/releases/tag/v9.40.0
297
301
  [9.39.0]: https://github.com/gchq/CyberChef/releases/tag/v9.39.0
298
302
  [9.38.0]: https://github.com/gchq/CyberChef/releases/tag/v9.38.0
299
303
  [9.37.0]: https://github.com/gchq/CyberChef/releases/tag/v9.37.0
@@ -491,6 +495,7 @@ All major and minor version changes will be documented in this file. Details of
491
495
  [#674]: https://github.com/gchq/CyberChef/pull/674
492
496
  [#683]: https://github.com/gchq/CyberChef/pull/683
493
497
  [#865]: https://github.com/gchq/CyberChef/pull/865
498
+ [#906]: https://github.com/gchq/CyberChef/pull/906
494
499
  [#912]: https://github.com/gchq/CyberChef/pull/912
495
500
  [#917]: https://github.com/gchq/CyberChef/pull/917
496
501
  [#934]: https://github.com/gchq/CyberChef/pull/934
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberchef",
3
- "version": "9.40.0",
3
+ "version": "9.41.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",
@@ -97,6 +97,7 @@
97
97
  "Bacon Cipher Decode",
98
98
  "Bifid Cipher Encode",
99
99
  "Bifid Cipher Decode",
100
+ "Caesar Box Cipher",
100
101
  "Affine Cipher Encode",
101
102
  "Affine Cipher Decode",
102
103
  "A1Z26 Cipher Encode",
@@ -1469,6 +1469,22 @@
1469
1469
  "manualBake": false,
1470
1470
  "args": []
1471
1471
  },
1472
+ "Caesar Box Cipher": {
1473
+ "module": "Ciphers",
1474
+ "description": "Caesar Box is a transposition cipher used in the Roman Empire, in which letters of the message are written in rows in a square (or a rectangle) and then, read by column.",
1475
+ "infoURL": "https://www.dcode.fr/caesar-box-cipher",
1476
+ "inputType": "string",
1477
+ "outputType": "string",
1478
+ "flowControl": false,
1479
+ "manualBake": false,
1480
+ "args": [
1481
+ {
1482
+ "name": "Box Height",
1483
+ "type": "number",
1484
+ "value": 1
1485
+ }
1486
+ ]
1487
+ },
1472
1488
  "Cartesian Product": {
1473
1489
  "module": "Default",
1474
1490
  "description": "Calculates the cartesian product of multiple sets of data, returning all possible combinations.",
@@ -16,6 +16,7 @@ import BifidCipherDecode from "../../operations/BifidCipherDecode.mjs";
16
16
  import BifidCipherEncode from "../../operations/BifidCipherEncode.mjs";
17
17
  import BlowfishDecrypt from "../../operations/BlowfishDecrypt.mjs";
18
18
  import BlowfishEncrypt from "../../operations/BlowfishEncrypt.mjs";
19
+ import CaesarBoxCipher from "../../operations/CaesarBoxCipher.mjs";
19
20
  import DESDecrypt from "../../operations/DESDecrypt.mjs";
20
21
  import DESEncrypt from "../../operations/DESEncrypt.mjs";
21
22
  import DeriveEVPKey from "../../operations/DeriveEVPKey.mjs";
@@ -53,6 +54,7 @@ OpModules.Ciphers = {
53
54
  "Bifid Cipher Encode": BifidCipherEncode,
54
55
  "Blowfish Decrypt": BlowfishDecrypt,
55
56
  "Blowfish Encrypt": BlowfishEncrypt,
57
+ "Caesar Box Cipher": CaesarBoxCipher,
56
58
  "DES Decrypt": DESDecrypt,
57
59
  "DES Encrypt": DESEncrypt,
58
60
  "Derive EVP key": DeriveEVPKey,
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @author n1073645 [n1073645@gmail.com]
3
+ * @copyright Crown Copyright 2020
4
+ * @license Apache-2.0
5
+ */
6
+
7
+ import Operation from "../Operation.mjs";
8
+
9
+ /**
10
+ * Caesar Box Cipher operation
11
+ */
12
+ class CaesarBoxCipher extends Operation {
13
+
14
+ /**
15
+ * CaesarBoxCipher constructor
16
+ */
17
+ constructor() {
18
+ super();
19
+
20
+ this.name = "Caesar Box Cipher";
21
+ this.module = "Ciphers";
22
+ this.description = "Caesar Box is a transposition cipher used in the Roman Empire, in which letters of the message are written in rows in a square (or a rectangle) and then, read by column.";
23
+ this.infoURL = "https://www.dcode.fr/caesar-box-cipher";
24
+ this.inputType = "string";
25
+ this.outputType = "string";
26
+ this.args = [
27
+ {
28
+ name: "Box Height",
29
+ type: "number",
30
+ value: 1
31
+ }
32
+ ];
33
+ }
34
+
35
+ /**
36
+ * @param {string} input
37
+ * @param {Object[]} args
38
+ * @returns {string}
39
+ */
40
+ run(input, args) {
41
+ const tableHeight = args[0];
42
+ const tableWidth = Math.ceil(input.length / tableHeight);
43
+ while (input.indexOf(" ") !== -1)
44
+ input = input.replace(" ", "");
45
+ for (let i = 0; i < (tableHeight * tableWidth) - input.length; i++) {
46
+ input += "\x00";
47
+ }
48
+ let result = "";
49
+ for (let i = 0; i < tableHeight; i++) {
50
+ for (let j = i; j < input.length; j += tableHeight) {
51
+ if (input.charAt(j) !== "\x00") {
52
+ result += input.charAt(j);
53
+ }
54
+ }
55
+ }
56
+ return result;
57
+ }
58
+
59
+ }
60
+
61
+ export default CaesarBoxCipher;
@@ -48,6 +48,7 @@ import CSSMinify from "./CSSMinify.mjs";
48
48
  import CSSSelector from "./CSSSelector.mjs";
49
49
  import CSVToJSON from "./CSVToJSON.mjs";
50
50
  import CTPH from "./CTPH.mjs";
51
+ import CaesarBoxCipher from "./CaesarBoxCipher.mjs";
51
52
  import CartesianProduct from "./CartesianProduct.mjs";
52
53
  import ChangeIPFormat from "./ChangeIPFormat.mjs";
53
54
  import ChiSquare from "./ChiSquare.mjs";
@@ -423,6 +424,7 @@ export {
423
424
  CSSSelector,
424
425
  CSVToJSON,
425
426
  CTPH,
427
+ CaesarBoxCipher,
426
428
  CartesianProduct,
427
429
  ChangeIPFormat,
428
430
  ChiSquare,
@@ -58,6 +58,7 @@ import {
58
58
  CSSSelector as core_CSSSelector,
59
59
  CSVToJSON as core_CSVToJSON,
60
60
  CTPH as core_CTPH,
61
+ CaesarBoxCipher as core_CaesarBoxCipher,
61
62
  CartesianProduct as core_CartesianProduct,
62
63
  ChangeIPFormat as core_ChangeIPFormat,
63
64
  ChiSquare as core_ChiSquare,
@@ -433,6 +434,7 @@ function generateChef() {
433
434
  "CSSSelector": _wrap(core_CSSSelector),
434
435
  "CSVToJSON": _wrap(core_CSVToJSON),
435
436
  "CTPH": _wrap(core_CTPH),
437
+ "caesarBoxCipher": _wrap(core_CaesarBoxCipher),
436
438
  "cartesianProduct": _wrap(core_CartesianProduct),
437
439
  "changeIPFormat": _wrap(core_ChangeIPFormat),
438
440
  "chiSquare": _wrap(core_ChiSquare),
@@ -816,6 +818,7 @@ const CSSMinify = chef.CSSMinify;
816
818
  const CSSSelector = chef.CSSSelector;
817
819
  const CSVToJSON = chef.CSVToJSON;
818
820
  const CTPH = chef.CTPH;
821
+ const caesarBoxCipher = chef.caesarBoxCipher;
819
822
  const cartesianProduct = chef.cartesianProduct;
820
823
  const changeIPFormat = chef.changeIPFormat;
821
824
  const chiSquare = chef.chiSquare;
@@ -1193,6 +1196,7 @@ const operations = [
1193
1196
  CSSSelector,
1194
1197
  CSVToJSON,
1195
1198
  CTPH,
1199
+ caesarBoxCipher,
1196
1200
  cartesianProduct,
1197
1201
  changeIPFormat,
1198
1202
  chiSquare,
@@ -1574,6 +1578,7 @@ export {
1574
1578
  CSSSelector,
1575
1579
  CSVToJSON,
1576
1580
  CTPH,
1581
+ caesarBoxCipher,
1577
1582
  cartesianProduct,
1578
1583
  changeIPFormat,
1579
1584
  chiSquare,
@@ -116,6 +116,7 @@ import "./tests/GetAllCasings.mjs";
116
116
  import "./tests/SIGABA.mjs";
117
117
  import "./tests/ELFInfo.mjs";
118
118
  import "./tests/Subsection.mjs";
119
+ import "./tests/CaesarBoxCipher.mjs";
119
120
 
120
121
 
121
122
  // Cannot test operations that use the File type yet
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Caesar Box Cipher tests.
3
+ *
4
+ * @author n1073645 [n1073645@gmail.com]
5
+ *
6
+ * @copyright Crown Copyright 2020
7
+ * @license Apache-2.0
8
+ */
9
+ import TestRegister from "../../lib/TestRegister.mjs";
10
+
11
+ TestRegister.addTests([
12
+ {
13
+ name: "Caesar Box Cipher: nothing",
14
+ input: "",
15
+ expectedOutput: "",
16
+ recipeConfig: [
17
+ {
18
+ op: "Caesar Box Cipher",
19
+ args: ["1"],
20
+ },
21
+ ],
22
+ },
23
+ {
24
+ name: "Caesar Box Cipher: Hello World!",
25
+ input: "Hello World!",
26
+ expectedOutput: "Hlodeor!lWl",
27
+ recipeConfig: [
28
+ {
29
+ op: "Caesar Box Cipher",
30
+ args: ["3"],
31
+ },
32
+ ],
33
+ },
34
+ {
35
+ name: "Caesar Box Cipher: Hello World!",
36
+ input: "Hlodeor!lWl",
37
+ expectedOutput: "HelloWorld!",
38
+ recipeConfig: [
39
+ {
40
+ op: "Caesar Box Cipher",
41
+ args: ["4"],
42
+ },
43
+ ],
44
+ }
45
+ ]);