autokey {cryptography}R Documentation

Autokey Cipher

Description

This can be used to encrypt or decrypt an Autokey cipher. The Autokey Cipher is derived from the Vigenere Cipher, in which the key and plaintext are bound to generate a new encryption key for the Vigenere method. This Vigenere method uses only letters and numbers, as such any other characters used as inputs are not used in the cipher.

Usage

autokey(message, key, encrypt = TRUE)

Arguments

message

A character vector of plaintext to be encrypted or ciphertext to be decrypted

key

A character vector to be used as the encryption key

encrypt

(Default: TRUE) TRUE will encrypt the message, while FALSE will decrypt the message.

Value

A character vector of either plaintext that has been encrypted or ciphertext that has been decrypted.

Examples

autokey("VerySecretMessage", "Hack", encrypt = TRUE)
autokey("c4JYn8JfwNoLMbmAM", "Hack", encrypt = FALSE)
autokey("Very $%^&SecretMes(*sagĀ£$%e", "Hack", encrypt = TRUE)


[Package cryptography version 1.0.0 Index]