mirror of
https://github.com/gchq/CyberChef
synced 2025-12-14 23:33:25 +00:00
Add invalid key length error message
This commit is contained in:
@@ -70,7 +70,11 @@ class BlowfishDecrypt extends Operation {
|
|||||||
inputType = args[3],
|
inputType = args[3],
|
||||||
outputType = args[4];
|
outputType = args[4];
|
||||||
|
|
||||||
if (key.length === 0) throw new OperationError("Enter a key");
|
if (key.length !== 8) {
|
||||||
|
throw new OperationError(`Invalid key length: ${key.length} bytes
|
||||||
|
|
||||||
|
Blowfish uses a key length of 8 bytes (64 bits).`);
|
||||||
|
}
|
||||||
|
|
||||||
input = Utils.convertToByteString(input, inputType);
|
input = Utils.convertToByteString(input, inputType);
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,11 @@ class BlowfishEncrypt extends Operation {
|
|||||||
inputType = args[3],
|
inputType = args[3],
|
||||||
outputType = args[4];
|
outputType = args[4];
|
||||||
|
|
||||||
if (key.length === 0) throw new OperationError("Enter a key");
|
if (key.length !== 8) {
|
||||||
|
throw new OperationError(`Invalid key length: ${key.length} bytes
|
||||||
|
|
||||||
|
Blowfish uses a key length of 8 bytes (64 bits).`);
|
||||||
|
}
|
||||||
|
|
||||||
input = Utils.convertToByteString(input, inputType);
|
input = Utils.convertToByteString(input, inputType);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user