cyberchef 9.42.0 → 9.43.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.42.0] - 2022-07-08
17
+ - Added 'LS47 Encrypt' and 'LS47 Decrypt' operations [@n1073645] | [#951]
18
+
16
19
  ### [9.41.0] - 2022-07-08
17
20
  - Added 'Caesar Box Cipher' operation [@n1073645] | [#1066]
18
21
 
@@ -300,6 +303,7 @@ All major and minor version changes will be documented in this file. Details of
300
303
 
301
304
 
302
305
 
306
+ [9.42.0]: https://github.com/gchq/CyberChef/releases/tag/v9.42.0
303
307
  [9.41.0]: https://github.com/gchq/CyberChef/releases/tag/v9.41.0
304
308
  [9.40.0]: https://github.com/gchq/CyberChef/releases/tag/v9.40.0
305
309
  [9.39.0]: https://github.com/gchq/CyberChef/releases/tag/v9.39.0
@@ -504,6 +508,7 @@ All major and minor version changes will be documented in this file. Details of
504
508
  [#917]: https://github.com/gchq/CyberChef/pull/917
505
509
  [#934]: https://github.com/gchq/CyberChef/pull/934
506
510
  [#948]: https://github.com/gchq/CyberChef/pull/948
511
+ [#951]: https://github.com/gchq/CyberChef/pull/951
507
512
  [#952]: https://github.com/gchq/CyberChef/pull/952
508
513
  [#965]: https://github.com/gchq/CyberChef/pull/965
509
514
  [#966]: https://github.com/gchq/CyberChef/pull/966
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberchef",
3
- "version": "9.42.0",
3
+ "version": "9.43.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",
@@ -88,7 +88,9 @@
88
88
  "SM4 Encrypt",
89
89
  "SM4 Decrypt",
90
90
  "ROT13",
91
+ "ROT13 Brute Force",
91
92
  "ROT47",
93
+ "ROT47 Brute Force",
92
94
  "XOR",
93
95
  "XOR Brute Force",
94
96
  "Vigenère Encode",
@@ -10178,6 +10178,52 @@
10178
10178
  }
10179
10179
  ]
10180
10180
  },
10181
+ "ROT13 Brute Force": {
10182
+ "module": "Default",
10183
+ "description": "Try all meaningful amounts for ROT13.<br><br>Optionally you can enter your known plaintext (crib) to filter the result.",
10184
+ "infoURL": "https://wikipedia.org/wiki/ROT13",
10185
+ "inputType": "byteArray",
10186
+ "outputType": "string",
10187
+ "flowControl": false,
10188
+ "manualBake": false,
10189
+ "args": [
10190
+ {
10191
+ "name": "Rotate lower case chars",
10192
+ "type": "boolean",
10193
+ "value": true
10194
+ },
10195
+ {
10196
+ "name": "Rotate upper case chars",
10197
+ "type": "boolean",
10198
+ "value": true
10199
+ },
10200
+ {
10201
+ "name": "Rotate numbers",
10202
+ "type": "boolean",
10203
+ "value": false
10204
+ },
10205
+ {
10206
+ "name": "Sample length",
10207
+ "type": "number",
10208
+ "value": 100
10209
+ },
10210
+ {
10211
+ "name": "Sample offset",
10212
+ "type": "number",
10213
+ "value": 0
10214
+ },
10215
+ {
10216
+ "name": "Print amount",
10217
+ "type": "boolean",
10218
+ "value": true
10219
+ },
10220
+ {
10221
+ "name": "Crib (known plaintext string)",
10222
+ "type": "string",
10223
+ "value": ""
10224
+ }
10225
+ ]
10226
+ },
10181
10227
  "ROT47": {
10182
10228
  "module": "Default",
10183
10229
  "description": "A slightly more complex variation of a caesar cipher, which includes ASCII characters from 33 '!' to 126 '~'. Default rotation: 47.",
@@ -10194,6 +10240,37 @@
10194
10240
  }
10195
10241
  ]
10196
10242
  },
10243
+ "ROT47 Brute Force": {
10244
+ "module": "Default",
10245
+ "description": "Try all meaningful amounts for ROT47.<br><br>Optionally you can enter your known plaintext (crib) to filter the result.",
10246
+ "infoURL": "https://wikipedia.org/wiki/ROT13#Variants",
10247
+ "inputType": "byteArray",
10248
+ "outputType": "string",
10249
+ "flowControl": false,
10250
+ "manualBake": false,
10251
+ "args": [
10252
+ {
10253
+ "name": "Sample length",
10254
+ "type": "number",
10255
+ "value": 100
10256
+ },
10257
+ {
10258
+ "name": "Sample offset",
10259
+ "type": "number",
10260
+ "value": 0
10261
+ },
10262
+ {
10263
+ "name": "Print amount",
10264
+ "type": "boolean",
10265
+ "value": true
10266
+ },
10267
+ {
10268
+ "name": "Crib (known plaintext string)",
10269
+ "type": "string",
10270
+ "value": ""
10271
+ }
10272
+ ]
10273
+ },
10197
10274
  "RSA Decrypt": {
10198
10275
  "module": "Ciphers",
10199
10276
  "description": "Decrypt an RSA encrypted message with a PEM encoded private key.",
@@ -107,7 +107,9 @@ import ParseUNIXFilePermissions from "../../operations/ParseUNIXFilePermissions.
107
107
  import PlayMedia from "../../operations/PlayMedia.mjs";
108
108
  import PowerSet from "../../operations/PowerSet.mjs";
109
109
  import ROT13 from "../../operations/ROT13.mjs";
110
+ import ROT13BruteForce from "../../operations/ROT13BruteForce.mjs";
110
111
  import ROT47 from "../../operations/ROT47.mjs";
112
+ import ROT47BruteForce from "../../operations/ROT47BruteForce.mjs";
111
113
  import RemoveDiacritics from "../../operations/RemoveDiacritics.mjs";
112
114
  import RemoveLineNumbers from "../../operations/RemoveLineNumbers.mjs";
113
115
  import RemoveNullBytes from "../../operations/RemoveNullBytes.mjs";
@@ -277,7 +279,9 @@ OpModules.Default = {
277
279
  "Play Media": PlayMedia,
278
280
  "Power Set": PowerSet,
279
281
  "ROT13": ROT13,
282
+ "ROT13 Brute Force": ROT13BruteForce,
280
283
  "ROT47": ROT47,
284
+ "ROT47 Brute Force": ROT47BruteForce,
281
285
  "Remove Diacritics": RemoveDiacritics,
282
286
  "Remove line numbers": RemoveLineNumbers,
283
287
  "Remove null bytes": RemoveNullBytes,
@@ -0,0 +1,102 @@
1
+ /**
2
+ * @author MikeCAT
3
+ * @license Apache-2.0
4
+ */
5
+
6
+ import Operation from "../Operation.mjs";
7
+ import Utils from "../Utils.mjs";
8
+
9
+ /**
10
+ * ROT13 Brute Force operation.
11
+ */
12
+ class ROT13BruteForce extends Operation {
13
+
14
+ /**
15
+ * ROT13BruteForce constructor
16
+ */
17
+ constructor() {
18
+ super();
19
+
20
+ this.name = "ROT13 Brute Force";
21
+ this.module = "Default";
22
+ this.description = "Try all meaningful amounts for ROT13.<br><br>Optionally you can enter your known plaintext (crib) to filter the result.";
23
+ this.infoURL = "https://wikipedia.org/wiki/ROT13";
24
+ this.inputType = "byteArray";
25
+ this.outputType = "string";
26
+ this.args = [
27
+ {
28
+ name: "Rotate lower case chars",
29
+ type: "boolean",
30
+ value: true
31
+ },
32
+ {
33
+ name: "Rotate upper case chars",
34
+ type: "boolean",
35
+ value: true
36
+ },
37
+ {
38
+ name: "Rotate numbers",
39
+ type: "boolean",
40
+ value: false
41
+ },
42
+ {
43
+ name: "Sample length",
44
+ type: "number",
45
+ value: 100
46
+ },
47
+ {
48
+ name: "Sample offset",
49
+ type: "number",
50
+ value: 0
51
+ },
52
+ {
53
+ name: "Print amount",
54
+ type: "boolean",
55
+ value: true
56
+ },
57
+ {
58
+ name: "Crib (known plaintext string)",
59
+ type: "string",
60
+ value: ""
61
+ }
62
+ ];
63
+ }
64
+
65
+ /**
66
+ * @param {byteArray} input
67
+ * @param {Object[]} args
68
+ * @returns {string}
69
+ */
70
+ run(input, args) {
71
+ const [rotateLower, rotateUpper, rotateNum, sampleLength, sampleOffset, printAmount, crib] = args;
72
+ const sample = input.slice(sampleOffset, sampleOffset + sampleLength);
73
+ const cribLower = crib.toLowerCase();
74
+ const lowerStart = "a".charCodeAt(0), upperStart = "A".charCodeAt(0), numStart = "0".charCodeAt(0);
75
+ const result = [];
76
+ for (let amount = 1; amount < 26; amount++) {
77
+ const rotated = sample.slice();
78
+ for (let i = 0; i < rotated.length; i++) {
79
+ if (rotateLower && lowerStart <= rotated[i] && rotated[i] < lowerStart + 26) {
80
+ rotated[i] = (rotated[i] - lowerStart + amount) % 26 + lowerStart;
81
+ } else if (rotateUpper && upperStart <= rotated[i] && rotated[i] < upperStart + 26) {
82
+ rotated[i] = (rotated[i] - upperStart + amount) % 26 + upperStart;
83
+ } else if (rotateNum && numStart <= rotated[i] && rotated[i] < numStart + 10) {
84
+ rotated[i] = (rotated[i] - numStart + amount) % 10 + numStart;
85
+ }
86
+ }
87
+ const rotatedString = Utils.byteArrayToUtf8(rotated);
88
+ if (rotatedString.toLowerCase().indexOf(cribLower) >= 0) {
89
+ const rotatedStringPrintable = Utils.printable(rotatedString, false);
90
+ if (printAmount) {
91
+ const amountStr = "Amount = " + (" " + amount).slice(-2) + ": ";
92
+ result.push(amountStr + rotatedStringPrintable);
93
+ } else {
94
+ result.push(rotatedStringPrintable);
95
+ }
96
+ }
97
+ }
98
+ return result.join("\n");
99
+ }
100
+ }
101
+
102
+ export default ROT13BruteForce;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @author MikeCAT
3
+ * @license Apache-2.0
4
+ */
5
+
6
+ import Operation from "../Operation.mjs";
7
+ import Utils from "../Utils.mjs";
8
+
9
+ /**
10
+ * ROT47 Brute Force operation.
11
+ */
12
+ class ROT47BruteForce extends Operation {
13
+
14
+ /**
15
+ * ROT47BruteForce constructor
16
+ */
17
+ constructor() {
18
+ super();
19
+
20
+ this.name = "ROT47 Brute Force";
21
+ this.module = "Default";
22
+ this.description = "Try all meaningful amounts for ROT47.<br><br>Optionally you can enter your known plaintext (crib) to filter the result.";
23
+ this.infoURL = "https://wikipedia.org/wiki/ROT13#Variants";
24
+ this.inputType = "byteArray";
25
+ this.outputType = "string";
26
+ this.args = [
27
+ {
28
+ name: "Sample length",
29
+ type: "number",
30
+ value: 100
31
+ },
32
+ {
33
+ name: "Sample offset",
34
+ type: "number",
35
+ value: 0
36
+ },
37
+ {
38
+ name: "Print amount",
39
+ type: "boolean",
40
+ value: true
41
+ },
42
+ {
43
+ name: "Crib (known plaintext string)",
44
+ type: "string",
45
+ value: ""
46
+ }
47
+ ];
48
+ }
49
+
50
+ /**
51
+ * @param {byteArray} input
52
+ * @param {Object[]} args
53
+ * @returns {string}
54
+ */
55
+ run(input, args) {
56
+ const [sampleLength, sampleOffset, printAmount, crib] = args;
57
+ const sample = input.slice(sampleOffset, sampleOffset + sampleLength);
58
+ const cribLower = crib.toLowerCase();
59
+ const result = [];
60
+ for (let amount = 1; amount < 94; amount++) {
61
+ const rotated = sample.slice();
62
+ for (let i = 0; i < rotated.length; i++) {
63
+ if (33 <= rotated[i] && rotated[i] <= 126) {
64
+ rotated[i] = (rotated[i] - 33 + amount) % 94 + 33;
65
+ }
66
+ }
67
+ const rotatedString = Utils.byteArrayToUtf8(rotated);
68
+ if (rotatedString.toLowerCase().indexOf(cribLower) >= 0) {
69
+ const rotatedStringPrintable = Utils.printable(rotatedString, false);
70
+ if (printAmount) {
71
+ const amountStr = "Amount = " + (" " + amount).slice(-2) + ": ";
72
+ result.push(amountStr + rotatedStringPrintable);
73
+ } else {
74
+ result.push(rotatedStringPrintable);
75
+ }
76
+ }
77
+ }
78
+ return result.join("\n");
79
+ }
80
+ }
81
+
82
+ export default ROT47BruteForce;
@@ -252,7 +252,9 @@ import RC4 from "./RC4.mjs";
252
252
  import RC4Drop from "./RC4Drop.mjs";
253
253
  import RIPEMD from "./RIPEMD.mjs";
254
254
  import ROT13 from "./ROT13.mjs";
255
+ import ROT13BruteForce from "./ROT13BruteForce.mjs";
255
256
  import ROT47 from "./ROT47.mjs";
257
+ import ROT47BruteForce from "./ROT47BruteForce.mjs";
256
258
  import RSADecrypt from "./RSADecrypt.mjs";
257
259
  import RSAEncrypt from "./RSAEncrypt.mjs";
258
260
  import RSASign from "./RSASign.mjs";
@@ -630,7 +632,9 @@ export {
630
632
  RC4Drop,
631
633
  RIPEMD,
632
634
  ROT13,
635
+ ROT13BruteForce,
633
636
  ROT47,
637
+ ROT47BruteForce,
634
638
  RSADecrypt,
635
639
  RSAEncrypt,
636
640
  RSASign,
@@ -253,7 +253,9 @@ import {
253
253
  RC4Drop as core_RC4Drop,
254
254
  RIPEMD as core_RIPEMD,
255
255
  ROT13 as core_ROT13,
256
+ ROT13BruteForce as core_ROT13BruteForce,
256
257
  ROT47 as core_ROT47,
258
+ ROT47BruteForce as core_ROT47BruteForce,
257
259
  RSADecrypt as core_RSADecrypt,
258
260
  RSAEncrypt as core_RSAEncrypt,
259
261
  RSASign as core_RSASign,
@@ -631,7 +633,9 @@ function generateChef() {
631
633
  "RC4Drop": _wrap(core_RC4Drop),
632
634
  "RIPEMD": _wrap(core_RIPEMD),
633
635
  "ROT13": _wrap(core_ROT13),
636
+ "ROT13BruteForce": _wrap(core_ROT13BruteForce),
634
637
  "ROT47": _wrap(core_ROT47),
638
+ "ROT47BruteForce": _wrap(core_ROT47BruteForce),
635
639
  "RSADecrypt": _wrap(core_RSADecrypt),
636
640
  "RSAEncrypt": _wrap(core_RSAEncrypt),
637
641
  "RSASign": _wrap(core_RSASign),
@@ -1026,7 +1030,9 @@ const RC4 = chef.RC4;
1026
1030
  const RC4Drop = chef.RC4Drop;
1027
1031
  const RIPEMD = chef.RIPEMD;
1028
1032
  const ROT13 = chef.ROT13;
1033
+ const ROT13BruteForce = chef.ROT13BruteForce;
1029
1034
  const ROT47 = chef.ROT47;
1035
+ const ROT47BruteForce = chef.ROT47BruteForce;
1030
1036
  const RSADecrypt = chef.RSADecrypt;
1031
1037
  const RSAEncrypt = chef.RSAEncrypt;
1032
1038
  const RSASign = chef.RSASign;
@@ -1406,7 +1412,9 @@ const operations = [
1406
1412
  RC4Drop,
1407
1413
  RIPEMD,
1408
1414
  ROT13,
1415
+ ROT13BruteForce,
1409
1416
  ROT47,
1417
+ ROT47BruteForce,
1410
1418
  RSADecrypt,
1411
1419
  RSAEncrypt,
1412
1420
  RSASign,
@@ -1790,7 +1798,9 @@ export {
1790
1798
  RC4Drop,
1791
1799
  RIPEMD,
1792
1800
  ROT13,
1801
+ ROT13BruteForce,
1793
1802
  ROT47,
1803
+ ROT47BruteForce,
1794
1804
  RSADecrypt,
1795
1805
  RSAEncrypt,
1796
1806
  RSASign,