simple_substitution {ciphertext}R Documentation

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))

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

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)

Examples

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


[Package ciphertext version 0.1.1 Index]