cyberchef 9.45.0 → 9.46.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 +6 -0
- package/package.json +1 -1
- package/src/core/config/Categories.json +2 -0
- package/src/core/config/OperationConfig.json +27 -0
- package/src/core/config/modules/Ciphers.mjs +4 -0
- package/src/core/operations/CetaceanCipherDecode.mjs +63 -0
- package/src/core/operations/CetaceanCipherEncode.mjs +51 -0
- package/src/core/operations/index.mjs +4 -0
- package/src/node/index.mjs +10 -0
- package/tests/operations/index.mjs +2 -0
- package/tests/operations/tests/CetaceanCipherDecode.mjs +22 -0
- package/tests/operations/tests/CetaceanCipherEncode.mjs +22 -0
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.45.0] - 2022-07-08
|
|
17
|
+
- Added 'ROT8000' operation [@thomasleplus] | [#1250]
|
|
18
|
+
|
|
16
19
|
### [9.44.0] - 2022-07-08
|
|
17
20
|
- Added 'LZString Compress' and 'LZString Decompress' operations [@crespyl] | [#1266]
|
|
18
21
|
|
|
@@ -309,6 +312,7 @@ All major and minor version changes will be documented in this file. Details of
|
|
|
309
312
|
|
|
310
313
|
|
|
311
314
|
|
|
315
|
+
[9.45.0]: https://github.com/gchq/CyberChef/releases/tag/v9.45.0
|
|
312
316
|
[9.44.0]: https://github.com/gchq/CyberChef/releases/tag/v9.44.0
|
|
313
317
|
[9.43.0]: https://github.com/gchq/CyberChef/releases/tag/v9.43.0
|
|
314
318
|
[9.42.0]: https://github.com/gchq/CyberChef/releases/tag/v9.42.0
|
|
@@ -440,6 +444,7 @@ All major and minor version changes will be documented in this file. Details of
|
|
|
440
444
|
[@swesven]: https://github.com/swesven
|
|
441
445
|
[@mikecat]: https://github.com/mikecat
|
|
442
446
|
[@crespyl]: https://github.com/crespyl
|
|
447
|
+
[@thomasleplus]: https://github.com/thomasleplus
|
|
443
448
|
|
|
444
449
|
[8ad18b]: https://github.com/gchq/CyberChef/commit/8ad18bc7db6d9ff184ba3518686293a7685bf7b7
|
|
445
450
|
[9a33498]: https://github.com/gchq/CyberChef/commit/9a33498fed26a8df9c9f35f39a78a174bf50a513
|
|
@@ -540,4 +545,5 @@ All major and minor version changes will be documented in this file. Details of
|
|
|
540
545
|
[#1364]: https://github.com/gchq/CyberChef/pull/1364
|
|
541
546
|
[#1264]: https://github.com/gchq/CyberChef/pull/1264
|
|
542
547
|
[#1266]: https://github.com/gchq/CyberChef/pull/1266
|
|
548
|
+
[#1250]: https://github.com/gchq/CyberChef/pull/1250
|
|
543
549
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cyberchef",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.46.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",
|
|
@@ -1506,6 +1506,33 @@
|
|
|
1506
1506
|
}
|
|
1507
1507
|
]
|
|
1508
1508
|
},
|
|
1509
|
+
"Cetacean Cipher Decode": {
|
|
1510
|
+
"module": "Ciphers",
|
|
1511
|
+
"description": "Decode Cetacean Cipher input. <br/><br/>e.g. <code>EEEEEEEEEeeEeEEEEEEEEEEEEeeEeEEe</code> becomes <code>hi</code>",
|
|
1512
|
+
"infoURL": "https://hitchhikers.fandom.com/wiki/Dolphins",
|
|
1513
|
+
"inputType": "string",
|
|
1514
|
+
"outputType": "string",
|
|
1515
|
+
"flowControl": false,
|
|
1516
|
+
"manualBake": false,
|
|
1517
|
+
"args": [],
|
|
1518
|
+
"checks": [
|
|
1519
|
+
{
|
|
1520
|
+
"pattern": "^(?:[eE]{16,})(?: [eE]{16,})*$",
|
|
1521
|
+
"flags": "",
|
|
1522
|
+
"args": []
|
|
1523
|
+
}
|
|
1524
|
+
]
|
|
1525
|
+
},
|
|
1526
|
+
"Cetacean Cipher Encode": {
|
|
1527
|
+
"module": "Ciphers",
|
|
1528
|
+
"description": "Converts any input into Cetacean Cipher. <br/><br/>e.g. <code>hi</code> becomes <code>EEEEEEEEEeeEeEEEEEEEEEEEEeeEeEEe</code>",
|
|
1529
|
+
"infoURL": "https://hitchhikers.fandom.com/wiki/Dolphins",
|
|
1530
|
+
"inputType": "string",
|
|
1531
|
+
"outputType": "string",
|
|
1532
|
+
"flowControl": false,
|
|
1533
|
+
"manualBake": false,
|
|
1534
|
+
"args": []
|
|
1535
|
+
},
|
|
1509
1536
|
"Change IP format": {
|
|
1510
1537
|
"module": "Default",
|
|
1511
1538
|
"description": "Convert an IP address from one format to another, e.g. <code>172.20.23.54</code> to <code>ac141736</code>",
|
|
@@ -17,6 +17,8 @@ import BifidCipherEncode from "../../operations/BifidCipherEncode.mjs";
|
|
|
17
17
|
import BlowfishDecrypt from "../../operations/BlowfishDecrypt.mjs";
|
|
18
18
|
import BlowfishEncrypt from "../../operations/BlowfishEncrypt.mjs";
|
|
19
19
|
import CaesarBoxCipher from "../../operations/CaesarBoxCipher.mjs";
|
|
20
|
+
import CetaceanCipherDecode from "../../operations/CetaceanCipherDecode.mjs";
|
|
21
|
+
import CetaceanCipherEncode from "../../operations/CetaceanCipherEncode.mjs";
|
|
20
22
|
import DESDecrypt from "../../operations/DESDecrypt.mjs";
|
|
21
23
|
import DESEncrypt from "../../operations/DESEncrypt.mjs";
|
|
22
24
|
import DeriveEVPKey from "../../operations/DeriveEVPKey.mjs";
|
|
@@ -55,6 +57,8 @@ OpModules.Ciphers = {
|
|
|
55
57
|
"Blowfish Decrypt": BlowfishDecrypt,
|
|
56
58
|
"Blowfish Encrypt": BlowfishEncrypt,
|
|
57
59
|
"Caesar Box Cipher": CaesarBoxCipher,
|
|
60
|
+
"Cetacean Cipher Decode": CetaceanCipherDecode,
|
|
61
|
+
"Cetacean Cipher Encode": CetaceanCipherEncode,
|
|
58
62
|
"DES Decrypt": DESDecrypt,
|
|
59
63
|
"DES Encrypt": DESEncrypt,
|
|
60
64
|
"Derive EVP key": DeriveEVPKey,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author dolphinOnKeys [robin@weird.io]
|
|
3
|
+
* @copyright Crown Copyright 2022
|
|
4
|
+
* @license Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import Operation from "../Operation.mjs";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Cetacean Cipher Decode operation
|
|
11
|
+
*/
|
|
12
|
+
class CetaceanCipherDecode extends Operation {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* CetaceanCipherDecode constructor
|
|
16
|
+
*/
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
|
|
20
|
+
this.name = "Cetacean Cipher Decode";
|
|
21
|
+
this.module = "Ciphers";
|
|
22
|
+
this.description = "Decode Cetacean Cipher input. <br/><br/>e.g. <code>EEEEEEEEEeeEeEEEEEEEEEEEEeeEeEEe</code> becomes <code>hi</code>";
|
|
23
|
+
this.infoURL = "https://hitchhikers.fandom.com/wiki/Dolphins";
|
|
24
|
+
this.inputType = "string";
|
|
25
|
+
this.outputType = "string";
|
|
26
|
+
|
|
27
|
+
this.checks = [
|
|
28
|
+
{
|
|
29
|
+
pattern: "^(?:[eE]{16,})(?: [eE]{16,})*$",
|
|
30
|
+
flags: "",
|
|
31
|
+
args: []
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param {string} input
|
|
38
|
+
* @param {Object[]} args
|
|
39
|
+
* @returns {string}
|
|
40
|
+
*/
|
|
41
|
+
run(input, args) {
|
|
42
|
+
const binaryArray = [];
|
|
43
|
+
for (const char of input) {
|
|
44
|
+
if (char === " ") {
|
|
45
|
+
binaryArray.push(...[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]);
|
|
46
|
+
} else {
|
|
47
|
+
binaryArray.push(char === "e" ? 1 : 0);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const byteArray = [];
|
|
52
|
+
|
|
53
|
+
for (let i = 0; i < binaryArray.length; i += 16) {
|
|
54
|
+
byteArray.push(binaryArray.slice(i, i + 16).join(""));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return byteArray.map(byte =>
|
|
58
|
+
String.fromCharCode(parseInt(byte, 2))
|
|
59
|
+
).join("");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default CetaceanCipherDecode;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author dolphinOnKeys [robin@weird.io]
|
|
3
|
+
* @copyright Crown Copyright 2022
|
|
4
|
+
* @license Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import Operation from "../Operation.mjs";
|
|
8
|
+
import {toBinary} from "../lib/Binary.mjs";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Cetacean Cipher Encode operation
|
|
12
|
+
*/
|
|
13
|
+
class CetaceanCipherEncode extends Operation {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* CetaceanCipherEncode constructor
|
|
17
|
+
*/
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
|
|
21
|
+
this.name = "Cetacean Cipher Encode";
|
|
22
|
+
this.module = "Ciphers";
|
|
23
|
+
this.description = "Converts any input into Cetacean Cipher. <br/><br/>e.g. <code>hi</code> becomes <code>EEEEEEEEEeeEeEEEEEEEEEEEEeeEeEEe</code>";
|
|
24
|
+
this.infoURL = "https://hitchhikers.fandom.com/wiki/Dolphins";
|
|
25
|
+
this.inputType = "string";
|
|
26
|
+
this.outputType = "string";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @param {string} input
|
|
31
|
+
* @param {Object[]} args
|
|
32
|
+
* @returns {string}
|
|
33
|
+
*/
|
|
34
|
+
run(input, args) {
|
|
35
|
+
const result = [];
|
|
36
|
+
const charArray = input.split("");
|
|
37
|
+
|
|
38
|
+
charArray.map(character => {
|
|
39
|
+
if (character === " ") {
|
|
40
|
+
result.push(character);
|
|
41
|
+
} else {
|
|
42
|
+
const binaryArray = toBinary(character.charCodeAt(0), "None", 16).split("");
|
|
43
|
+
result.push(binaryArray.map(str => str === "1" ? "e" : "E").join(""));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return result.join("");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default CetaceanCipherEncode;
|
|
@@ -50,6 +50,8 @@ import CSVToJSON from "./CSVToJSON.mjs";
|
|
|
50
50
|
import CTPH from "./CTPH.mjs";
|
|
51
51
|
import CaesarBoxCipher from "./CaesarBoxCipher.mjs";
|
|
52
52
|
import CartesianProduct from "./CartesianProduct.mjs";
|
|
53
|
+
import CetaceanCipherDecode from "./CetaceanCipherDecode.mjs";
|
|
54
|
+
import CetaceanCipherEncode from "./CetaceanCipherEncode.mjs";
|
|
53
55
|
import ChangeIPFormat from "./ChangeIPFormat.mjs";
|
|
54
56
|
import ChiSquare from "./ChiSquare.mjs";
|
|
55
57
|
import CipherSaber2Decrypt from "./CipherSaber2Decrypt.mjs";
|
|
@@ -433,6 +435,8 @@ export {
|
|
|
433
435
|
CTPH,
|
|
434
436
|
CaesarBoxCipher,
|
|
435
437
|
CartesianProduct,
|
|
438
|
+
CetaceanCipherDecode,
|
|
439
|
+
CetaceanCipherEncode,
|
|
436
440
|
ChangeIPFormat,
|
|
437
441
|
ChiSquare,
|
|
438
442
|
CipherSaber2Decrypt,
|
package/src/node/index.mjs
CHANGED
|
@@ -60,6 +60,8 @@ import {
|
|
|
60
60
|
CTPH as core_CTPH,
|
|
61
61
|
CaesarBoxCipher as core_CaesarBoxCipher,
|
|
62
62
|
CartesianProduct as core_CartesianProduct,
|
|
63
|
+
CetaceanCipherDecode as core_CetaceanCipherDecode,
|
|
64
|
+
CetaceanCipherEncode as core_CetaceanCipherEncode,
|
|
63
65
|
ChangeIPFormat as core_ChangeIPFormat,
|
|
64
66
|
ChiSquare as core_ChiSquare,
|
|
65
67
|
CipherSaber2Decrypt as core_CipherSaber2Decrypt,
|
|
@@ -443,6 +445,8 @@ function generateChef() {
|
|
|
443
445
|
"CTPH": _wrap(core_CTPH),
|
|
444
446
|
"caesarBoxCipher": _wrap(core_CaesarBoxCipher),
|
|
445
447
|
"cartesianProduct": _wrap(core_CartesianProduct),
|
|
448
|
+
"cetaceanCipherDecode": _wrap(core_CetaceanCipherDecode),
|
|
449
|
+
"cetaceanCipherEncode": _wrap(core_CetaceanCipherEncode),
|
|
446
450
|
"changeIPFormat": _wrap(core_ChangeIPFormat),
|
|
447
451
|
"chiSquare": _wrap(core_ChiSquare),
|
|
448
452
|
"cipherSaber2Decrypt": _wrap(core_CipherSaber2Decrypt),
|
|
@@ -834,6 +838,8 @@ const CSVToJSON = chef.CSVToJSON;
|
|
|
834
838
|
const CTPH = chef.CTPH;
|
|
835
839
|
const caesarBoxCipher = chef.caesarBoxCipher;
|
|
836
840
|
const cartesianProduct = chef.cartesianProduct;
|
|
841
|
+
const cetaceanCipherDecode = chef.cetaceanCipherDecode;
|
|
842
|
+
const cetaceanCipherEncode = chef.cetaceanCipherEncode;
|
|
837
843
|
const changeIPFormat = chef.changeIPFormat;
|
|
838
844
|
const chiSquare = chef.chiSquare;
|
|
839
845
|
const cipherSaber2Decrypt = chef.cipherSaber2Decrypt;
|
|
@@ -1219,6 +1225,8 @@ const operations = [
|
|
|
1219
1225
|
CTPH,
|
|
1220
1226
|
caesarBoxCipher,
|
|
1221
1227
|
cartesianProduct,
|
|
1228
|
+
cetaceanCipherDecode,
|
|
1229
|
+
cetaceanCipherEncode,
|
|
1222
1230
|
changeIPFormat,
|
|
1223
1231
|
chiSquare,
|
|
1224
1232
|
cipherSaber2Decrypt,
|
|
@@ -1608,6 +1616,8 @@ export {
|
|
|
1608
1616
|
CTPH,
|
|
1609
1617
|
caesarBoxCipher,
|
|
1610
1618
|
cartesianProduct,
|
|
1619
|
+
cetaceanCipherDecode,
|
|
1620
|
+
cetaceanCipherEncode,
|
|
1611
1621
|
changeIPFormat,
|
|
1612
1622
|
chiSquare,
|
|
1613
1623
|
cipherSaber2Decrypt,
|
|
@@ -28,6 +28,8 @@ import "./tests/Base85.mjs";
|
|
|
28
28
|
import "./tests/BitwiseOp.mjs";
|
|
29
29
|
import "./tests/ByteRepr.mjs";
|
|
30
30
|
import "./tests/CartesianProduct.mjs";
|
|
31
|
+
import "./tests/CetaceanCipherEncode.mjs";
|
|
32
|
+
import "./tests/CetaceanCipherDecode.mjs";
|
|
31
33
|
import "./tests/CharEnc.mjs";
|
|
32
34
|
import "./tests/ChangeIPFormat.mjs";
|
|
33
35
|
import "./tests/Charts.mjs";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CetaceanCipher Encode tests
|
|
3
|
+
*
|
|
4
|
+
* @author dolphinOnKeys
|
|
5
|
+
* @copyright Crown Copyright 2022
|
|
6
|
+
* @licence Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
import TestRegister from "../../lib/TestRegister.mjs";
|
|
9
|
+
|
|
10
|
+
TestRegister.addTests([
|
|
11
|
+
{
|
|
12
|
+
name: "Cetacean Cipher Decode",
|
|
13
|
+
input: "EEEEEEEEEeeEEEEe EEEEEEEEEeeEEEeE EEEEEEEEEeeEEEee EEeeEEEEEeeEEeee",
|
|
14
|
+
expectedOutput: "a b c で",
|
|
15
|
+
recipeConfig: [
|
|
16
|
+
{
|
|
17
|
+
op: "Cetacean Cipher Decode",
|
|
18
|
+
args: []
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
}
|
|
22
|
+
]);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CetaceanCipher Encode tests
|
|
3
|
+
*
|
|
4
|
+
* @author dolphinOnKeys
|
|
5
|
+
* @copyright Crown Copyright 2022
|
|
6
|
+
* @licence Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
import TestRegister from "../../lib/TestRegister.mjs";
|
|
9
|
+
|
|
10
|
+
TestRegister.addTests([
|
|
11
|
+
{
|
|
12
|
+
name: "Cetacean Cipher Encode",
|
|
13
|
+
input: "a b c で",
|
|
14
|
+
expectedOutput: "EEEEEEEEEeeEEEEe EEEEEEEEEeeEEEeE EEEEEEEEEeeEEEee EEeeEEEEEeeEEeee",
|
|
15
|
+
recipeConfig: [
|
|
16
|
+
{
|
|
17
|
+
op: "Cetacean Cipher Encode",
|
|
18
|
+
args: []
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
}
|
|
22
|
+
]);
|