cyberchef 9.50.4 → 9.50.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cyberchef",
|
|
3
|
-
"version": "9.50.
|
|
3
|
+
"version": "9.50.6",
|
|
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",
|
|
@@ -70,7 +70,7 @@ class TripleDESDecrypt extends Operation {
|
|
|
70
70
|
inputType = args[3],
|
|
71
71
|
outputType = args[4];
|
|
72
72
|
|
|
73
|
-
if (key.length !== 24) {
|
|
73
|
+
if (key.length !== 24 && key.length !== 16) {
|
|
74
74
|
throw new OperationError(`Invalid key length: ${key.length} bytes
|
|
75
75
|
|
|
76
76
|
Triple DES uses a key length of 24 bytes (192 bits).
|
|
@@ -85,7 +85,8 @@ Make sure you have specified the type correctly (e.g. Hex vs UTF8).`);
|
|
|
85
85
|
|
|
86
86
|
input = Utils.convertToByteString(input, inputType);
|
|
87
87
|
|
|
88
|
-
const decipher = forge.cipher.createDecipher("3DES-" + mode,
|
|
88
|
+
const decipher = forge.cipher.createDecipher("3DES-" + mode,
|
|
89
|
+
key.length === 16 ? key + key.substring(0, 8) : key);
|
|
89
90
|
|
|
90
91
|
/* Allow for a "no padding" mode */
|
|
91
92
|
if (noPadding) {
|
|
@@ -69,7 +69,7 @@ class TripleDESEncrypt extends Operation {
|
|
|
69
69
|
inputType = args[3],
|
|
70
70
|
outputType = args[4];
|
|
71
71
|
|
|
72
|
-
if (key.length !== 24) {
|
|
72
|
+
if (key.length !== 24 && key.length !== 16) {
|
|
73
73
|
throw new OperationError(`Invalid key length: ${key.length} bytes
|
|
74
74
|
|
|
75
75
|
Triple DES uses a key length of 24 bytes (192 bits).
|
|
@@ -84,7 +84,8 @@ Make sure you have specified the type correctly (e.g. Hex vs UTF8).`);
|
|
|
84
84
|
|
|
85
85
|
input = Utils.convertToByteString(input, inputType);
|
|
86
86
|
|
|
87
|
-
const cipher = forge.cipher.createCipher("3DES-" + mode,
|
|
87
|
+
const cipher = forge.cipher.createCipher("3DES-" + mode,
|
|
88
|
+
key.length === 16 ? key + key.substring(0, 8) : key);
|
|
88
89
|
cipher.start({iv: iv});
|
|
89
90
|
cipher.update(forge.util.createBuffer(input));
|
|
90
91
|
cipher.finish();
|