mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 15:56:16 -04:00
Encrypt with user-supplied alphabets
This commit is contained in:
parent
ede3dc7471
commit
6876d90e78
1 changed files with 7 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import { affineEncrypt } from "../lib/Ciphers.mjs";
|
import { affineEncrypt, AFFINE_ALPHABETS } from "../lib/Ciphers.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Affine Cipher Encode operation
|
* Affine Cipher Encode operation
|
||||||
|
@ -34,6 +34,11 @@ class AffineCipherEncode extends Operation {
|
||||||
"name": "b",
|
"name": "b",
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"value": 0
|
"value": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Alphabet",
|
||||||
|
"type": "editableOption",
|
||||||
|
"value": AFFINE_ALPHABETS
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -45,7 +50,7 @@ class AffineCipherEncode extends Operation {
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
const a = args[0], b = args[1], alphabet = args[2];
|
const a = args[0], b = args[1], alphabet = args[2];
|
||||||
return affineEncrypt(input, a, b, "a-z");
|
return affineEncrypt(input, a, b, alphabet);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue