R/cipher-reverse.R

Defines functions decrypt_cipher_reverse encrypt_cipher_reverse

encrypt_cipher_reverse <- function(plaintext) {

  ciphertext <- plaintext %>%
    base::strsplit(split = "") %>%
    `[[`(1) %>% base::rev() %>%
    paste(collapse = "")

  ciphertext

}

decrypt_cipher_reverse <- function(ciphertext) {

  plaintext <- ciphertext %>%
    base::strsplit(split = "") %>%
    `[[`(1) %>% base::rev() %>%
    paste(collapse = "")

  plaintext

}
rtjohnson12/cipher documentation built on Dec. 22, 2021, 8:10 p.m.