cyberchef 11.1.0 → 11.3.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/AGENTS.md +75 -0
- package/CHANGELOG.md +173 -2
- package/Dockerfile +2 -2
- package/Gruntfile.js +1 -0
- package/README.md +7 -6
- package/SECURITY.md +3 -1
- package/package.json +22 -21
- package/src/core/Chef.mjs +2 -0
- package/src/core/Dish.mjs +1 -5
- package/src/core/Ingredient.mjs +92 -0
- package/src/core/Operation.mjs +19 -0
- package/src/core/Recipe.mjs +4 -0
- package/src/core/Utils.mjs +48 -0
- package/src/core/config/Categories.json +22 -6
- package/src/core/config/OperationConfig.json +4774 -1228
- package/src/core/config/modules/Ciphers.mjs +20 -0
- package/src/core/config/modules/Crypto.mjs +10 -0
- package/src/core/config/modules/Default.mjs +8 -0
- package/src/core/config/modules/File.mjs +16 -0
- package/src/core/config/modules/OpModules.mjs +2 -0
- package/src/core/config/scripts/generateHTMLEntities.mjs +139 -0
- package/src/core/config/scripts/htmlEntityOverrides.mjs +86 -0
- package/src/core/dishTypes/DishType.mjs +1 -1
- package/src/core/errors/ExcludedOperationError.mjs +1 -1
- package/src/core/lib/Arithmetic.mjs +21 -5
- package/src/core/lib/BigIntUtils.mjs +0 -1
- package/src/core/lib/COBS.mjs +86 -0
- package/src/core/lib/Charts.mjs +3 -3
- package/src/core/lib/Decimal.mjs +5 -5
- package/src/core/lib/HTMLEntities.mjs +2068 -0
- package/src/core/lib/Present.mjs +422 -0
- package/src/core/lib/Protocol.mjs +8 -6
- package/src/core/lib/TEA.mjs +494 -0
- package/src/core/lib/TLVParser.mjs +16 -7
- package/src/core/lib/Twofish.mjs +608 -0
- package/src/core/operations/AsconDecrypt.mjs +112 -0
- package/src/core/operations/AsconEncrypt.mjs +108 -0
- package/src/core/operations/AsconHash.mjs +49 -0
- package/src/core/operations/AsconMAC.mjs +68 -0
- package/src/core/operations/AutomatedValidationTestOp.mjs +84 -0
- package/src/core/operations/AvroToJSON.mjs +1 -1
- package/src/core/operations/BLAKE3.mjs +5 -1
- package/src/core/operations/BcryptCompare.mjs +11 -5
- package/src/core/operations/BitShiftLeft.mjs +4 -1
- package/src/core/operations/Bzip2Compress.mjs +1 -1
- package/src/core/operations/DechunkHTTPResponse.mjs +4 -1
- package/src/core/operations/ExtendedGCD.mjs +101 -0
- package/src/core/operations/FromBase.mjs +2 -1
- package/src/core/operations/FromCOBS.mjs +38 -0
- package/src/core/operations/FromDecimal.mjs +6 -1
- package/src/core/operations/FromHTMLEntity.mjs +2 -1458
- package/src/core/operations/GenerateDeBruijnSequence.mjs +8 -0
- package/src/core/operations/GenerateHOTP.mjs +21 -6
- package/src/core/operations/GenerateImage.mjs +22 -10
- package/src/core/operations/GeneratePrime.mjs +154 -0
- package/src/core/operations/GenerateTOTP.mjs +24 -7
- package/src/core/operations/Gzip.mjs +1 -3
- package/src/core/operations/Jsonata.mjs +12 -0
- package/src/core/operations/MIMEDecoding.mjs +1 -1
- package/src/core/operations/MOD.mjs +62 -0
- package/src/core/operations/ModularInverse.mjs +107 -0
- package/src/core/operations/PRESENTDecrypt.mjs +94 -0
- package/src/core/operations/PRESENTEncrypt.mjs +94 -0
- package/src/core/operations/ParityBit.mjs +1 -1
- package/src/core/operations/ParseIPv4Header.mjs +1 -1
- package/src/core/operations/ParseURI.mjs +18 -5
- package/src/core/operations/PseudoRandomNumberGenerator.mjs +2 -1
- package/src/core/operations/RandomPrime.mjs +154 -0
- package/src/core/operations/RenderPDF.mjs +100 -0
- package/src/core/operations/SHA2.mjs +1 -1
- package/src/core/operations/SM4Encrypt.mjs +1 -1
- package/src/core/operations/SetDifference.mjs +8 -1
- package/src/core/operations/SetIntersection.mjs +8 -1
- package/src/core/operations/ShowOnMap.mjs +14 -2
- package/src/core/operations/TEADecrypt.mjs +98 -0
- package/src/core/operations/TEAEncrypt.mjs +98 -0
- package/src/core/operations/ToBase.mjs +4 -4
- package/src/core/operations/ToBase32.mjs +20 -4
- package/src/core/operations/ToBinary.mjs +4 -1
- package/src/core/operations/ToCOBS.mjs +38 -0
- package/src/core/operations/ToHTMLEntity.mjs +7 -1430
- package/src/core/operations/ToHexdump.mjs +7 -1
- package/src/core/operations/TwofishDecrypt.mjs +94 -0
- package/src/core/operations/TwofishEncrypt.mjs +94 -0
- package/src/core/operations/URLEncode.mjs +22 -18
- package/src/core/operations/UnescapeUnicodeCharacters.mjs +2 -1
- package/src/core/operations/ViewBitPlane.mjs +9 -3
- package/src/core/operations/Wrap.mjs +5 -0
- package/src/core/operations/XORBruteForce.mjs +4 -1
- package/src/core/operations/XORChecksum.mjs +10 -3
- package/src/core/operations/XTEADecrypt.mjs +110 -0
- package/src/core/operations/XTEAEncrypt.mjs +110 -0
- package/src/core/operations/index.mjs +42 -0
- package/src/core/vendor/ascon.mjs +162 -0
- package/src/core/vendor/htmlEntities/entity.json +2233 -0
- package/src/core/vendor/htmlEntities/entity.txt +14 -0
- package/src/node/api.mjs +4 -1
- package/src/node/index.mjs +105 -0
- package/src/web/HTMLOperation.mjs +2 -1
- package/src/web/stylesheets/layout/_io.css +8 -0
- package/tests/browser/00_nightwatch.js +26 -0
- package/tests/browser/02_ops.js +20 -4
- package/tests/node/index.mjs +2 -0
- package/tests/node/tests/Dish.mjs +19 -0
- package/tests/node/tests/NodeDish.mjs +36 -0
- package/tests/node/tests/ToHTMLEntity.mjs +82 -0
- package/tests/node/tests/Utils.mjs +77 -0
- package/tests/node/tests/lib/ChartsProtocolPrototypePollution.mjs +90 -0
- package/tests/node/tests/nodeApi.mjs +33 -1
- package/tests/node/tests/operations.mjs +26 -1
- package/tests/operations/index.mjs +17 -0
- package/tests/operations/tests/Arithmetic.mjs +33 -0
- package/tests/operations/tests/Ascon.mjs +501 -0
- package/tests/operations/tests/AutomatedValidation.mjs +154 -0
- package/tests/operations/tests/BLAKE3.mjs +39 -1
- package/tests/operations/tests/Base32.mjs +22 -0
- package/tests/operations/tests/COBS.mjs +476 -0
- package/tests/operations/tests/CharEnc.mjs +2 -2
- package/tests/operations/tests/DechunkHTTPResponse.mjs +66 -0
- package/tests/operations/tests/ExtendedGCD.mjs +78 -0
- package/tests/operations/tests/FromBase.mjs +66 -0
- package/tests/operations/tests/FromDecimal.mjs +55 -0
- package/tests/operations/tests/GenerateLoremIpsum.mjs +2 -2
- package/tests/operations/tests/Gzip.mjs +60 -0
- package/tests/operations/tests/HTMLEntity.mjs +126 -0
- package/tests/operations/tests/Hash.mjs +44 -0
- package/tests/operations/tests/Hexdump.mjs +11 -0
- package/tests/operations/tests/Image.mjs +26 -0
- package/tests/operations/tests/Jsonata.mjs +23 -0
- package/tests/operations/tests/MIMEDecoding.mjs +33 -0
- package/tests/operations/tests/MOD.mjs +208 -0
- package/tests/operations/tests/Median.mjs +33 -0
- package/tests/operations/tests/ModularInverse.mjs +78 -0
- package/tests/operations/tests/OTP.mjs +167 -2
- package/tests/operations/tests/PRESENT.mjs +465 -0
- package/tests/operations/tests/ParseIPv4Header.mjs +11 -0
- package/tests/operations/tests/ParseTLV.mjs +41 -0
- package/tests/operations/tests/RenderPDF.mjs +55 -0
- package/tests/operations/tests/SM2.mjs +1 -1
- package/tests/operations/tests/SetDifference.mjs +22 -0
- package/tests/operations/tests/SetIntersection.mjs +23 -1
- package/tests/operations/tests/ShowOnMap.mjs +61 -0
- package/tests/operations/tests/TEA.mjs +566 -0
- package/tests/operations/tests/Twofish.mjs +486 -0
- package/tests/operations/tests/URLEncodeDecode.mjs +26 -0
- package/tests/operations/tests/UnescapeUnicodeCharacters.mjs +88 -0
- package/tests/operations/tests/Wrap.mjs +44 -0
- package/webpack.config.js +3 -3
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extended GCD tests.
|
|
3
|
+
*
|
|
4
|
+
* @author p-leriche [philip.leriche@cantab.net]
|
|
5
|
+
*
|
|
6
|
+
* @copyright Crown Copyright 2025
|
|
7
|
+
* @license Apache-2.0
|
|
8
|
+
*/
|
|
9
|
+
import TestRegister from "../../lib/TestRegister.mjs";
|
|
10
|
+
|
|
11
|
+
TestRegister.addTests([
|
|
12
|
+
{
|
|
13
|
+
name: "Extended GCD: coprime numbers (3, 11)",
|
|
14
|
+
input: "",
|
|
15
|
+
expectedOutput: "gcd: 1\n\nBezout coefficients:\nx = 4\ny = -1\n\n",
|
|
16
|
+
recipeConfig: [
|
|
17
|
+
{
|
|
18
|
+
op: "Extended GCD",
|
|
19
|
+
args: ["3", "11"],
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "Extended GCD: non-coprime numbers (240, 46)",
|
|
25
|
+
input: "",
|
|
26
|
+
expectedOutput: "gcd: 2\n\nBezout coefficients:\nx = -9\ny = 47\n\n",
|
|
27
|
+
recipeConfig: [
|
|
28
|
+
{
|
|
29
|
+
op: "Extended GCD",
|
|
30
|
+
args: ["240", "46"],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Extended GCD: with zero (17, 0)",
|
|
36
|
+
input: "",
|
|
37
|
+
expectedOutput: "gcd: 17\n\nBezout coefficients:\nx = 1\ny = 0\n\n",
|
|
38
|
+
recipeConfig: [
|
|
39
|
+
{
|
|
40
|
+
op: "Extended GCD",
|
|
41
|
+
args: ["17", "0"],
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "Extended GCD: hexadecimal input (0xFF, 0x11)",
|
|
47
|
+
input: "",
|
|
48
|
+
expectedOutput: "gcd: 17\n\nBezout coefficients:\nx = 0\ny = 1\n\n",
|
|
49
|
+
recipeConfig: [
|
|
50
|
+
{
|
|
51
|
+
op: "Extended GCD",
|
|
52
|
+
args: ["0xFF", "0x11"],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "Extended GCD: using input field for value a",
|
|
58
|
+
input: "42",
|
|
59
|
+
expectedOutput: "gcd: 7\n\nBezout coefficients:\nx = 1\ny = -1\n\n",
|
|
60
|
+
recipeConfig: [
|
|
61
|
+
{
|
|
62
|
+
op: "Extended GCD",
|
|
63
|
+
args: ["", "35"],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "Extended GCD: large numbers",
|
|
69
|
+
input: "",
|
|
70
|
+
expectedOutput: "gcd: 2\n\nBezout coefficients:\nx = 12703973750415151\ny = -1577756566311408967124629843\n\n",
|
|
71
|
+
recipeConfig: [
|
|
72
|
+
{
|
|
73
|
+
op: "Extended GCD",
|
|
74
|
+
args: ["123456789012345678901234567890", "994064509324197316"],
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
]);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* From Base operation tests.
|
|
3
|
+
*
|
|
4
|
+
* @author Willi Ballenthin
|
|
5
|
+
* @copyright Crown Copyright 2026
|
|
6
|
+
* @license Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
import TestRegister from "../../lib/TestRegister.mjs";
|
|
9
|
+
|
|
10
|
+
TestRegister.addTests([
|
|
11
|
+
{
|
|
12
|
+
name: "From Base: binary integer",
|
|
13
|
+
input: "1010",
|
|
14
|
+
expectedOutput: "10",
|
|
15
|
+
recipeConfig: [
|
|
16
|
+
{
|
|
17
|
+
op: "From Base",
|
|
18
|
+
args: [2],
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "From Base: binary fraction",
|
|
24
|
+
input: "10.1",
|
|
25
|
+
expectedOutput: "2.5",
|
|
26
|
+
recipeConfig: [
|
|
27
|
+
{
|
|
28
|
+
op: "From Base",
|
|
29
|
+
args: [2],
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "From Base: hex fraction",
|
|
35
|
+
input: "a.8",
|
|
36
|
+
expectedOutput: "10.5",
|
|
37
|
+
recipeConfig: [
|
|
38
|
+
{
|
|
39
|
+
op: "From Base",
|
|
40
|
+
args: [16],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "From Base: octal integer",
|
|
46
|
+
input: "77",
|
|
47
|
+
expectedOutput: "63",
|
|
48
|
+
recipeConfig: [
|
|
49
|
+
{
|
|
50
|
+
op: "From Base",
|
|
51
|
+
args: [8],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "From Base: octal fraction",
|
|
57
|
+
input: "7.4",
|
|
58
|
+
expectedOutput: "7.5",
|
|
59
|
+
recipeConfig: [
|
|
60
|
+
{
|
|
61
|
+
op: "From Base",
|
|
62
|
+
args: [8],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
]);
|
|
@@ -30,4 +30,59 @@ TestRegister.addTests([
|
|
|
30
30
|
},
|
|
31
31
|
],
|
|
32
32
|
},
|
|
33
|
+
{
|
|
34
|
+
name: "From Decimal with Auto delimiter (space)",
|
|
35
|
+
input: "72 101 108 108 111",
|
|
36
|
+
expectedOutput: "Hello",
|
|
37
|
+
recipeConfig: [
|
|
38
|
+
{
|
|
39
|
+
op: "From Decimal",
|
|
40
|
+
args: ["Auto", false]
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "From Decimal with Auto delimiter (comma)",
|
|
46
|
+
input: "72,101,108,108,111",
|
|
47
|
+
expectedOutput: "Hello",
|
|
48
|
+
recipeConfig: [
|
|
49
|
+
{
|
|
50
|
+
op: "From Decimal",
|
|
51
|
+
args: ["Auto", false]
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "From Decimal with Auto delimiter (mixed)",
|
|
57
|
+
input: "72, 101 : 108; 108\t111",
|
|
58
|
+
expectedOutput: "Hello",
|
|
59
|
+
recipeConfig: [
|
|
60
|
+
{
|
|
61
|
+
op: "From Decimal",
|
|
62
|
+
args: ["Auto", false]
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "From Decimal with Auto delimiter (newline)",
|
|
68
|
+
input: "72\n101\n108\n108\n111",
|
|
69
|
+
expectedOutput: "Hello",
|
|
70
|
+
recipeConfig: [
|
|
71
|
+
{
|
|
72
|
+
op: "From Decimal",
|
|
73
|
+
args: ["Auto", false]
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "From Decimal with Auto delimiter and signed values",
|
|
79
|
+
input: "-130 -140 -152 -151 115 33 0 -1",
|
|
80
|
+
expectedOutput: "~this!\u0000\u00ff",
|
|
81
|
+
recipeConfig: [
|
|
82
|
+
{
|
|
83
|
+
op: "From Decimal",
|
|
84
|
+
args: ["Auto", true]
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
33
88
|
]);
|
|
@@ -67,12 +67,12 @@ TestRegister.addTests([
|
|
|
67
67
|
{
|
|
68
68
|
name: "Generate Lorem Ipsum: Incorrect lengthType",
|
|
69
69
|
input: "",
|
|
70
|
-
expectedOutput: "
|
|
70
|
+
expectedOutput: "Length in must be one of the following: Paragraphs, Sentences, Words, Bytes.",
|
|
71
71
|
recipeConfig: [
|
|
72
72
|
{
|
|
73
73
|
"op": "Generate Lorem Ipsum",
|
|
74
74
|
"args": [999_999, "Novels"]
|
|
75
|
-
}
|
|
75
|
+
}
|
|
76
76
|
],
|
|
77
77
|
},
|
|
78
78
|
|
|
@@ -86,4 +86,64 @@ TestRegister.addTests([
|
|
|
86
86
|
}
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
|
+
{
|
|
90
|
+
name: "Gzip: Comment with checksum round-trips through Gunzip",
|
|
91
|
+
input: "hello hello hello",
|
|
92
|
+
expectedOutput: "hello hello hello",
|
|
93
|
+
recipeConfig: [
|
|
94
|
+
{
|
|
95
|
+
op: "Gzip",
|
|
96
|
+
args: ["Dynamic Huffman Coding", "", "test", true]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
op: "Gunzip",
|
|
100
|
+
args: []
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "Gzip: Filename and comment with checksum round-trips through Gunzip",
|
|
106
|
+
input: "The quick brown fox jumped over the slow dog",
|
|
107
|
+
expectedOutput: "The quick brown fox jumped over the slow dog",
|
|
108
|
+
recipeConfig: [
|
|
109
|
+
{
|
|
110
|
+
op: "Gzip",
|
|
111
|
+
args: ["Dynamic Huffman Coding", "file.txt", "a comment", true]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
op: "Gunzip",
|
|
115
|
+
args: []
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "Gzip: No comment, with checksum round-trips through Gunzip",
|
|
121
|
+
input: "The quick brown fox jumped over the slow dog",
|
|
122
|
+
expectedOutput: "The quick brown fox jumped over the slow dog",
|
|
123
|
+
recipeConfig: [
|
|
124
|
+
{
|
|
125
|
+
op: "Gzip",
|
|
126
|
+
args: ["Dynamic Huffman Coding", "", "", true]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
op: "Gunzip",
|
|
130
|
+
args: []
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "Gzip: No options round-trips through Gunzip",
|
|
136
|
+
input: "The quick brown fox jumped over the slow dog",
|
|
137
|
+
expectedOutput: "The quick brown fox jumped over the slow dog",
|
|
138
|
+
recipeConfig: [
|
|
139
|
+
{
|
|
140
|
+
op: "Gzip",
|
|
141
|
+
args: ["Dynamic Huffman Coding", "", "", false]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
op: "Gunzip",
|
|
145
|
+
args: []
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
89
149
|
]);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* To/From HTML Entity tests.
|
|
3
|
+
*
|
|
4
|
+
* @author roberson-io [michaelroberson@gmail.com]
|
|
5
|
+
* @copyright Crown Copyright 2026
|
|
6
|
+
* @license Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
import TestRegister from "../../lib/TestRegister.mjs";
|
|
9
|
+
|
|
10
|
+
TestRegister.addTests([
|
|
11
|
+
{
|
|
12
|
+
name: "To HTML Entity: named",
|
|
13
|
+
input: "<a href='#'>\"&\"</a>",
|
|
14
|
+
expectedOutput: "<a href='#'>"&"</a>",
|
|
15
|
+
recipeConfig: [
|
|
16
|
+
{ op: "To HTML Entity", args: [false, "Named entities"] },
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
// Regression: this value was "⇌;" (stray trailing semicolon) in the
|
|
21
|
+
// original byteToEntity table. See issue #2645.
|
|
22
|
+
name: "To HTML Entity: malformed value fixed (U+21CC)",
|
|
23
|
+
input: "⇌",
|
|
24
|
+
expectedOutput: "⇌",
|
|
25
|
+
recipeConfig: [
|
|
26
|
+
{ op: "To HTML Entity", args: [false, "Named entities"] },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
// Regression: U+03F5 emitted "ε," before; the spec name is ϵ
|
|
31
|
+
// (ε is U+03B5). See issue #2645.
|
|
32
|
+
name: "To HTML Entity: spec-conformant name (U+03F5)",
|
|
33
|
+
input: "ϵ",
|
|
34
|
+
expectedOutput: "ϵ",
|
|
35
|
+
recipeConfig: [
|
|
36
|
+
{ op: "To HTML Entity", args: [false, "Named entities"] },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
// Regression: the OHM SIGN previously emitted the non-conformant Ω
|
|
41
|
+
// (spec Ω is U+03A9). It now encodes numerically.
|
|
42
|
+
name: "To HTML Entity: non-conformant name dropped (U+2126 ohm sign)",
|
|
43
|
+
input: "Ω",
|
|
44
|
+
expectedOutput: "Ω",
|
|
45
|
+
recipeConfig: [
|
|
46
|
+
{ op: "To HTML Entity", args: [false, "Named entities"] },
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
// The FULL BLOCK previously decoded to █ but never encoded to it.
|
|
51
|
+
// Generating both tables from the spec fixes this asymmetry.
|
|
52
|
+
name: "To HTML Entity: encode/decode symmetry (U+2588 block)",
|
|
53
|
+
input: "█",
|
|
54
|
+
expectedOutput: "█",
|
|
55
|
+
recipeConfig: [
|
|
56
|
+
{ op: "To HTML Entity", args: [false, "Named entities"] },
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "To HTML Entity: numeric, convert all",
|
|
61
|
+
input: "A<",
|
|
62
|
+
expectedOutput: "A<",
|
|
63
|
+
recipeConfig: [
|
|
64
|
+
{ op: "To HTML Entity", args: [true, "Numeric entities"] },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "To HTML Entity: hex, convert all",
|
|
69
|
+
input: "A<",
|
|
70
|
+
expectedOutput: "A<",
|
|
71
|
+
recipeConfig: [
|
|
72
|
+
{ op: "To HTML Entity", args: [true, "Hex entities"] },
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "From HTML Entity: named",
|
|
77
|
+
input: "<a href='#'>"&"</a>",
|
|
78
|
+
expectedOutput: "<a href='#'>\"&\"</a>",
|
|
79
|
+
recipeConfig: [
|
|
80
|
+
{ op: "From HTML Entity", args: [] },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
// Legacy/alias names still decode, now to the spec code point.
|
|
85
|
+
name: "From HTML Entity: alias to spec code point (Ω)",
|
|
86
|
+
input: "Ω",
|
|
87
|
+
expectedOutput: "Ω",
|
|
88
|
+
recipeConfig: [
|
|
89
|
+
{ op: "From HTML Entity", args: [] },
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "From HTML Entity: decimal numeric entity",
|
|
94
|
+
input: "A",
|
|
95
|
+
expectedOutput: "A",
|
|
96
|
+
recipeConfig: [
|
|
97
|
+
{ op: "From HTML Entity", args: [] },
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "From HTML Entity: hex numeric entity",
|
|
102
|
+
input: "A",
|
|
103
|
+
expectedOutput: "A",
|
|
104
|
+
recipeConfig: [
|
|
105
|
+
{ op: "From HTML Entity", args: [] },
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
// Unknown entities are passed through unchanged.
|
|
110
|
+
name: "From HTML Entity: invalid entity passed through",
|
|
111
|
+
input: "a ¬real; b",
|
|
112
|
+
expectedOutput: "a ¬real; b",
|
|
113
|
+
recipeConfig: [
|
|
114
|
+
{ op: "From HTML Entity", args: [] },
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "HTML Entity: round-trips through both operations",
|
|
119
|
+
input: "Hello <World> & \"friends\" — ⇌ █",
|
|
120
|
+
expectedOutput: "Hello <World> & \"friends\" — ⇌ █",
|
|
121
|
+
recipeConfig: [
|
|
122
|
+
{ op: "To HTML Entity", args: [true, "Named entities"] },
|
|
123
|
+
{ op: "From HTML Entity", args: [] },
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
]);
|
|
@@ -722,6 +722,39 @@ TestRegister.addTests([
|
|
|
722
722
|
}
|
|
723
723
|
]
|
|
724
724
|
},
|
|
725
|
+
{
|
|
726
|
+
name: "HMAC: Decimal key space-delimited matches Latin1 key (fromDecimal Auto delimiter regression)",
|
|
727
|
+
input: "Hello, World!",
|
|
728
|
+
expectedOutput: "9b641a008211bb0464a10899d5b37a24ab08ffcf839f5e74d17d99f856530957",
|
|
729
|
+
recipeConfig: [
|
|
730
|
+
{
|
|
731
|
+
"op": "HMAC",
|
|
732
|
+
"args": [{"option": "Decimal", "string": "65 65"}, "SHA256"]
|
|
733
|
+
}
|
|
734
|
+
]
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
name: "HMAC: Latin1 key matches space-delimited Decimal key (fromDecimal Auto delimiter regression)",
|
|
738
|
+
input: "Hello, World!",
|
|
739
|
+
expectedOutput: "9b641a008211bb0464a10899d5b37a24ab08ffcf839f5e74d17d99f856530957",
|
|
740
|
+
recipeConfig: [
|
|
741
|
+
{
|
|
742
|
+
"op": "HMAC",
|
|
743
|
+
"args": [{"option": "Latin1", "string": "AA"}, "SHA256"]
|
|
744
|
+
}
|
|
745
|
+
]
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
name: "HMAC: Decimal key comma-delimited matches Latin1 key (fromDecimal Auto delimiter regression)",
|
|
749
|
+
input: "Hello, World!",
|
|
750
|
+
expectedOutput: "9b641a008211bb0464a10899d5b37a24ab08ffcf839f5e74d17d99f856530957",
|
|
751
|
+
recipeConfig: [
|
|
752
|
+
{
|
|
753
|
+
"op": "HMAC",
|
|
754
|
+
"args": [{"option": "Decimal", "string": "65,65"}, "SHA256"]
|
|
755
|
+
}
|
|
756
|
+
]
|
|
757
|
+
},
|
|
725
758
|
{
|
|
726
759
|
name: "MD5: Complex bytes",
|
|
727
760
|
input: "10dc10e32010de10d010dc10d810d910d010e12e",
|
|
@@ -993,6 +1026,17 @@ TestRegister.addTests([
|
|
|
993
1026
|
}
|
|
994
1027
|
]
|
|
995
1028
|
},
|
|
1029
|
+
{
|
|
1030
|
+
name: "Bcrypt compare: invalid salt version",
|
|
1031
|
+
input: "password",
|
|
1032
|
+
expectedOutput: "Error: Invalid salt version: $a",
|
|
1033
|
+
recipeConfig: [
|
|
1034
|
+
{
|
|
1035
|
+
op: "Bcrypt compare",
|
|
1036
|
+
args: ["$ab$04$K.H1WlFDQ/iIo/PiprT/puwluJ5rzuSE5q8D/Fk3NuLgU2aXiGR9m"]
|
|
1037
|
+
}
|
|
1038
|
+
]
|
|
1039
|
+
},
|
|
996
1040
|
{
|
|
997
1041
|
name: "Scrypt: RFC test vector 1",
|
|
998
1042
|
input: "",
|
|
@@ -126,6 +126,17 @@ TestRegister.addTests([
|
|
|
126
126
|
}
|
|
127
127
|
],
|
|
128
128
|
},
|
|
129
|
+
{
|
|
130
|
+
name: "To Hexdump: Width too large",
|
|
131
|
+
input: "H",
|
|
132
|
+
expectedOutput: "Width must be less than or equal to 65536.",
|
|
133
|
+
recipeConfig: [
|
|
134
|
+
{
|
|
135
|
+
op: "To Hexdump",
|
|
136
|
+
args: [155555555555555, false, false, false]
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
},
|
|
129
140
|
{
|
|
130
141
|
name: "From Hexdump: xxd",
|
|
131
142
|
input: `00000000: 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f ................
|
|
@@ -45,6 +45,17 @@ TestRegister.addTests([
|
|
|
45
45
|
{ op: "Render Image", args: ["Base64"] }
|
|
46
46
|
]
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
name: "Generate Image: empty mode",
|
|
50
|
+
input: "",
|
|
51
|
+
expectedOutput: "Mode cannot be empty.",
|
|
52
|
+
recipeConfig: [
|
|
53
|
+
{
|
|
54
|
+
op: "Generate Image",
|
|
55
|
+
args: ["", 8, 64]
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
48
59
|
{
|
|
49
60
|
name: "Extract EXIF: nothing",
|
|
50
61
|
input: "",
|
|
@@ -230,6 +241,21 @@ TestRegister.addTests([
|
|
|
230
241
|
}
|
|
231
242
|
]
|
|
232
243
|
},
|
|
244
|
+
{
|
|
245
|
+
name: "View Bit Plane: malformed PNG",
|
|
246
|
+
input: PNG_HEX.replace("49484452", "49424452"),
|
|
247
|
+
expectedOutput: "Error loading image. (Error: unrecognised content at end of stream)",
|
|
248
|
+
recipeConfig: [
|
|
249
|
+
{
|
|
250
|
+
op: "From Hex",
|
|
251
|
+
args: ["None"]
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
op: "View Bit Plane",
|
|
255
|
+
args: ["Red", 0]
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
233
259
|
{
|
|
234
260
|
name: "Randomize Colour Palette",
|
|
235
261
|
"input": PNG_HEX,
|
|
@@ -548,4 +548,27 @@ TestRegister.addTests([
|
|
|
548
548
|
},
|
|
549
549
|
],
|
|
550
550
|
},
|
|
551
|
+
// Base64 functions (issue #2063)
|
|
552
|
+
{
|
|
553
|
+
name: "Jsonata: $base64decode",
|
|
554
|
+
input: "{}",
|
|
555
|
+
expectedOutput: '"Hello World!"',
|
|
556
|
+
recipeConfig: [
|
|
557
|
+
{
|
|
558
|
+
op: "Jsonata Query",
|
|
559
|
+
args: ['$base64decode("SGVsbG8gV29ybGQh")'],
|
|
560
|
+
},
|
|
561
|
+
],
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
name: "Jsonata: $base64encode",
|
|
565
|
+
input: "{}",
|
|
566
|
+
expectedOutput: '"SGVsbG8gV29ybGQh"',
|
|
567
|
+
recipeConfig: [
|
|
568
|
+
{
|
|
569
|
+
op: "Jsonata Query",
|
|
570
|
+
args: ['$base64encode("Hello World!")'],
|
|
571
|
+
},
|
|
572
|
+
],
|
|
573
|
+
},
|
|
551
574
|
]);
|
|
@@ -75,6 +75,39 @@ TestRegister.addTests([
|
|
|
75
75
|
}
|
|
76
76
|
]
|
|
77
77
|
},
|
|
78
|
+
{
|
|
79
|
+
name: "UTF-8 Base64 non-ASCII",
|
|
80
|
+
input: "Subject: =?UTF-8?B?Y2Fmw6k=?=",
|
|
81
|
+
expectedOutput: "Subject: café",
|
|
82
|
+
recipeConfig: [
|
|
83
|
+
{
|
|
84
|
+
"op": "MIME Decoding",
|
|
85
|
+
"args": []
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "UTF-8 Base64 multibyte CJK",
|
|
91
|
+
input: "Subject: =?UTF-8?B?5pel5pys6Kqe?=",
|
|
92
|
+
expectedOutput: "Subject: 日本語",
|
|
93
|
+
recipeConfig: [
|
|
94
|
+
{
|
|
95
|
+
"op": "MIME Decoding",
|
|
96
|
+
"args": []
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "UTF-8 Base64 ASCII-only",
|
|
102
|
+
input: "Subject: =?UTF-8?B?aGVsbG8=?=",
|
|
103
|
+
expectedOutput: "Subject: hello",
|
|
104
|
+
recipeConfig: [
|
|
105
|
+
{
|
|
106
|
+
"op": "MIME Decoding",
|
|
107
|
+
"args": []
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
78
111
|
{
|
|
79
112
|
name: "ISO Decoding",
|
|
80
113
|
input: "From: =?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>\nTo: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>\nCC: =?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>\nSubject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=\n=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=",
|