This can be used to create (encrypt) and solve (decrypt) a Railfence Cipher. A Railfence Cipher maps each letter to a cosine wave of the specified height where each letter resides at an integer rail height.
The Railfence Cipher Wikipedia entry provides more information on the methods used: https://en.wikipedia.org/wiki/Rail_fence_cipher
railfence(x, n = 1, decrypt = FALSE)
A character vector of length one that has been transformed
A vector to be encoded or decoded.
(Default: 1
) The width of the rail to be used. A width of one will
have no effect.
(Default: FALSE
) The default FALSE
will encrypt while
using TRUE
will decrypt a given value of x
.