Learn R Programming

ciphertext (version 0.1.0)

simple_substitution: simple_substitution

Description

simple substitution cipher. Each letter is monoalphabetically associated with a different one used for the encryption.

Usage

simple_substitution(word, key = "", seed = sample(1:1000, 1))

Value

a list with custom class "cipher", which modifies the printing defaults. The list contains the initial phrase (initial), the ciphered output (encrypted), and the alphabet order (keyalphabet)

Arguments

word

Word or phrase to be encrypted

key

Word to be used as key for the encryption. If not provided, a random shuffle is performed

seed

Seed for reproducibility of the encryption if key is not provided

Examples

Run this code
simple_substitution("hello world", seed = 1234)
simple_substitution("hello world", key = "zebras")

Run the code above in your browser using DataLab