Add effective key bits option with 128 by default to RC2 operation
This commit is contained in:
parent
d7915b1a15
commit
663f7480ad
@ -32,6 +32,11 @@ class RC2Decrypt extends Operation {
|
|||||||
"value": "",
|
"value": "",
|
||||||
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Effective key bits",
|
||||||
|
type: "number",
|
||||||
|
value: 128
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "IV",
|
"name": "IV",
|
||||||
"type": "toggleString",
|
"type": "toggleString",
|
||||||
@ -58,9 +63,10 @@ class RC2Decrypt extends Operation {
|
|||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
const key = Utils.convertToByteString(args[0].string, args[0].option),
|
const key = Utils.convertToByteString(args[0].string, args[0].option),
|
||||||
iv = Utils.convertToByteString(args[1].string, args[1].option),
|
effective = args[1],
|
||||||
[,, inputType, outputType] = args,
|
iv = Utils.convertToByteString(args[2].string, args[2].option),
|
||||||
decipher = forge.rc2.createDecryptionCipher(key);
|
[,,, inputType, outputType] = args,
|
||||||
|
decipher = forge.rc2.createDecryptionCipher(key, effective);
|
||||||
|
|
||||||
input = Utils.convertToByteString(input, inputType);
|
input = Utils.convertToByteString(input, inputType);
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import Operation from "../Operation.mjs";
|
|||||||
import Utils from "../Utils.mjs";
|
import Utils from "../Utils.mjs";
|
||||||
import forge from "node-forge";
|
import forge from "node-forge";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RC2 Encrypt operation
|
* RC2 Encrypt operation
|
||||||
*/
|
*/
|
||||||
@ -33,6 +32,11 @@ class RC2Encrypt extends Operation {
|
|||||||
"value": "",
|
"value": "",
|
||||||
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Effective key bits",
|
||||||
|
type: "number",
|
||||||
|
value: 128
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "IV",
|
"name": "IV",
|
||||||
"type": "toggleString",
|
"type": "toggleString",
|
||||||
@ -59,9 +63,10 @@ class RC2Encrypt extends Operation {
|
|||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
const key = Utils.convertToByteString(args[0].string, args[0].option),
|
const key = Utils.convertToByteString(args[0].string, args[0].option),
|
||||||
iv = Utils.convertToByteString(args[1].string, args[1].option),
|
effective = args[1],
|
||||||
[,, inputType, outputType] = args,
|
iv = Utils.convertToByteString(args[2].string, args[2].option),
|
||||||
cipher = forge.rc2.createEncryptionCipher(key);
|
[,,, inputType, outputType] = args,
|
||||||
|
cipher = forge.rc2.createEncryptionCipher(key, effective);
|
||||||
|
|
||||||
input = Utils.convertToByteString(input, inputType);
|
input = Utils.convertToByteString(input, inputType);
|
||||||
|
|
||||||
|
|||||||
@ -1488,6 +1488,7 @@ Triple DES uses a key length of 24 bytes (192 bits).`,
|
|||||||
"op": "RC2 Encrypt",
|
"op": "RC2 Encrypt",
|
||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
|
128,
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
"Hex", "Hex"
|
"Hex", "Hex"
|
||||||
]
|
]
|
||||||
@ -1503,6 +1504,7 @@ Triple DES uses a key length of 24 bytes (192 bits).`,
|
|||||||
"op": "RC2 Encrypt",
|
"op": "RC2 Encrypt",
|
||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "eb970554bb213430f4bb4e5988a6a218"},
|
{"option": "Hex", "string": "eb970554bb213430f4bb4e5988a6a218"},
|
||||||
|
128,
|
||||||
{"option": "Hex", "string": "ae817c784a097e0c"},
|
{"option": "Hex", "string": "ae817c784a097e0c"},
|
||||||
"Hex", "Hex"
|
"Hex", "Hex"
|
||||||
]
|
]
|
||||||
@ -1518,6 +1520,7 @@ Triple DES uses a key length of 24 bytes (192 bits).`,
|
|||||||
"op": "RC2 Encrypt",
|
"op": "RC2 Encrypt",
|
||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "eb970554bb213430f4bb4e5988a6a218"},
|
{"option": "Hex", "string": "eb970554bb213430f4bb4e5988a6a218"},
|
||||||
|
128,
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
"Hex", "Hex"
|
"Hex", "Hex"
|
||||||
]
|
]
|
||||||
@ -1533,6 +1536,7 @@ Triple DES uses a key length of 24 bytes (192 bits).`,
|
|||||||
"op": "RC2 Decrypt",
|
"op": "RC2 Decrypt",
|
||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
|
128,
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
"Hex", "Hex"
|
"Hex", "Hex"
|
||||||
]
|
]
|
||||||
@ -1548,6 +1552,7 @@ Triple DES uses a key length of 24 bytes (192 bits).`,
|
|||||||
"op": "RC2 Decrypt",
|
"op": "RC2 Decrypt",
|
||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "eb970554bb213430f4bb4e5988a6a218"},
|
{"option": "Hex", "string": "eb970554bb213430f4bb4e5988a6a218"},
|
||||||
|
128,
|
||||||
{"option": "Hex", "string": "ae817c784a097e0c"},
|
{"option": "Hex", "string": "ae817c784a097e0c"},
|
||||||
"Hex", "Hex"
|
"Hex", "Hex"
|
||||||
]
|
]
|
||||||
@ -1563,6 +1568,7 @@ Triple DES uses a key length of 24 bytes (192 bits).`,
|
|||||||
"op": "RC2 Decrypt",
|
"op": "RC2 Decrypt",
|
||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "eb970554bb213430f4bb4e5988a6a218"},
|
{"option": "Hex", "string": "eb970554bb213430f4bb4e5988a6a218"},
|
||||||
|
128,
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
"Hex", "Hex"
|
"Hex", "Hex"
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user