Open
Description
Describe the bug
The Rail Fence cipher trims white space when encoding, which makes the makes the decoding not work.
To Reproduce
- Input "These aren't the droid you're looking for"
- Rail Fence Cipher Encode
- Key:3 Offset:1
- Rail Fence Cipher Decode
- Key:3 Offset:1
- Output "Tresehare 't nhe troid yod'reuloo ingkfo"
Expected behaviour
The Output is the same text as the Input.
In the code for the rail fence cipher there is a .trim() that is removing the space that should exist as the first character. Using the provided settings the space that is the 13th character of the input becomes the first character of the encoded text. This character is then removed before the text is displayed in the Output.