Added length check to Triple DES IVs

This commit is contained in:
n1474335 committed 2019-10-16 15:50:37 +01:00
1 parent 011dc09d5e
commit be365f66ef
5 files changed
+18 -4

No files matched your search

+2 -1
View File
@@ -76,7 +76,8 @@ Triple DES uses a key length of 24 bytes (192 bits).`);
if (iv.length !== 8) {
throw new OperationError(`Invalid IV length: ${iv.length} bytes
DES uses an IV length of 8 bytes (64 bits).`);
DES uses an IV length of 8 bytes (64 bits).
Make sure you have specified the type correctly (e.g. Hex vs UTF8).`);
}
input = Utils.convertToByteString(input, inputType);
+2 -1
View File
@@ -76,7 +76,8 @@ Triple DES uses a key length of 24 bytes (192 bits).`);
if (iv.length !== 8) {
throw new OperationError(`Invalid IV length: ${iv.length} bytes
DES uses an IV length of 8 bytes (64 bits).`);
DES uses an IV length of 8 bytes (64 bits).
Make sure you have specified the type correctly (e.g. Hex vs UTF8).`);
}
input = Utils.convertToByteString(input, inputType);
+6
View File
@@ -75,6 +75,12 @@ class TripleDESDecrypt extends Operation {
Triple DES uses a key length of 24 bytes (192 bits).
DES uses a key length of 8 bytes (64 bits).`);
}
if (iv.length !== 8) {
throw new OperationError(`Invalid IV length: ${iv.length} bytes
Triple DES uses an IV length of 8 bytes (64 bits).
Make sure you have specified the type correctly (e.g. Hex vs UTF8).`);
}
input = Utils.convertToByteString(input, inputType);
+6
View File
@@ -75,6 +75,12 @@ class TripleDESEncrypt extends Operation {
Triple DES uses a key length of 24 bytes (192 bits).
DES uses a key length of 8 bytes (64 bits).`);
}
if (iv.length !== 8) {
throw new OperationError(`Invalid IV length: ${iv.length} bytes
Triple DES uses an IV length of 8 bytes (64 bits).
Make sure you have specified the type correctly (e.g. Hex vs UTF8).`);
}
input = Utils.convertToByteString(input, inputType);