Vigenere.Rd
Implements a Vigenere cypher, both encryption and decryption. The function handle keys and text of unequal length and discards non-alphabetic characters.
Vigenere(x, key = NULL, decrypt = FALSE)
All characters beside charlist = c(LETTERS, letters, 0:9) will be discarded from the text and from the key.
the encrypted, resp. decrypted text
key <- "My FavoriteKey452"
(xenc <- Vigenere("Beware the Jabberwock, my son! The jaws that bite, the claws that catch!", key))
#> [1] "NS10cIaFNnk5PYmo0QpCjWVLCBoDOqnltOy1TXLRQ8mFOqnltOy2LXJF"
Vigenere(xenc, key, decrypt = TRUE)
#> [1] "BewaretheJabberwockmysonThejawsthatbitetheclawsthatcatch"
# note that everything besides the characters in the list will be discarded