Added 'Substitute' operation.

This commit is contained in:
n1474335 2016-12-21 14:09:46 +00:00
parent e1ef228575
commit ef464ab57c
7 changed files with 83 additions and 27 deletions

View file

@ -82,6 +82,7 @@ const Categories = [
"XOR Brute Force",
"Vigenère Encode",
"Vigenère Decode",
"Substitute",
"Derive PBKDF2 key",
"Derive EVP key",
]

View file

@ -2863,5 +2863,23 @@ const OperationConfig = {
input_type: "string",
output_type: "string",
args: []
},
"Substitute": {
description: "A substitution cipher allowing you to specify bytes to replace with other byte values. This can be used to create Caesar ciphers but is more powerful as any byte value can be substituted, not just letters, and the substitution values need not be in order.<br><br>Enter the bytes you want to replace in the Plaintext field and the bytes to replace them with in the Ciphertext field.<br><br>Non-printable bytes can be specified using string escape notation. For example, a line feed character can be written as either <code>\\n</code> or <code>\\x0a</code>.<br><br>Byte ranges can be specified using a hyphen. For example, the sequence <code>0123456789</code> can be written as <code>0-9</code>.",
run: Cipher.run_substitute,
input_type: "byte_array",
output_type: "byte_array",
args: [
{
name: "Plaintext",
type: "binary_string",
value: Cipher.SUBS_PLAINTEXT
},
{
name: "Ciphertext",
type: "binary_string",
value: Cipher.SUBS_CIPHERTEXT
}
]
}
};