bacon.cipher: Bacon Cipher.

Description Usage Arguments Value Examples

View source: R/CIPH-fun.R

Description

A substitution cipher, in which every letter has a special, five-letter, code, except for i-j and u-v, which share a single value respectively. The final message is conveyed in the upper (represents "B" in bacon code) and lower (represents "A" in bacon code) of a decoy message.

Usage

1
bacon.cipher(ms, ..., code)

Arguments

ms

The message to be encrypted/decrypted in a single character object. The Raw message can be written in upper cases and spaces, but no numbers. The encrypted message needs to be written in upper cases and without spaces.

...

Utilized for the decoy message, that is, the message in which the bacon code is hidden in the upper and lower cases. Needs to be purely characters, and have a length equal or less than the total of the bacon code.

code

It refers to the transformation that will be made to the message: "encrypt" and "decrypt".

Value

For the encrypted message, returns a list of two: "Bacon Code" which is a single character object with all the bacon code; and "Decoy Message", which is a single character object with the hidden bacon code. For the decrypted message, a character vector is returned with the decrypted message.

Examples

1
2
3
4
5
#The decoy message can be shorter than the total of letters obtained from
#the bacon code. The rest of letters will be randomly generated.
bacon.cipher(ms = "Hello World", "This is not an encrypted Message", code = "encrypt")

bacon.cipher(ms = "thISIsnOtanEnCryPtEdmESsAGeTtpgEHvLQatjerWxPpgfvMC", code = "decrypt")

Red-Right-Hand1/CIPH_package documentation built on Dec. 18, 2021, 9:55 a.m.