mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 00:06:17 -04:00
Merge branch 'maqifrnswa-master'
This commit is contained in:
commit
b5162c7549
1 changed files with 1 additions and 8 deletions
|
@ -46,7 +46,7 @@ class RailFenceCipherDecode extends Operation {
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
const [key, offset] = args;
|
const [key, offset] = args;
|
||||||
|
|
||||||
let cipher = input;
|
const cipher = input;
|
||||||
|
|
||||||
if (key < 2) {
|
if (key < 2) {
|
||||||
throw new OperationError("Key has to be bigger than 2");
|
throw new OperationError("Key has to be bigger than 2");
|
||||||
|
@ -59,13 +59,6 @@ class RailFenceCipherDecode extends Operation {
|
||||||
}
|
}
|
||||||
|
|
||||||
const cycle = (key - 1) * 2;
|
const cycle = (key - 1) * 2;
|
||||||
|
|
||||||
const rest = cipher.length % key;
|
|
||||||
|
|
||||||
if (rest !== 0) {
|
|
||||||
cipher = cipher + (" ".repeat(key - rest));
|
|
||||||
}
|
|
||||||
|
|
||||||
const plaintext = new Array(cipher.length);
|
const plaintext = new Array(cipher.length);
|
||||||
|
|
||||||
let j = 0;
|
let j = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue