caesar.cipher: Caesar Cipher.

Description Usage Arguments Value Examples

View source: R/CIPH-fun.R

Description

Transforms by substitution a given message using a position shift of the alphabet, substituting each letter in the Raw message for a the letter that is a fixed number of positions ahead.

Usage

1
caesar.cipher(ms, pos.shift, code)

Arguments

ms

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

pos.shift

Indicates the position the alphabet will be shifted. Only accepts an integer between 1:26.

code

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

Value

A character object with the transformed message, using a position shift inside the alphabet to encrypt/decrypt the message.

Examples

1
2
3
caesar.cipher(ms = "Hello World", pos.shift = 1, code = "encrypt")

caesar.cipher(ms = "jgnnqyqtnf", pos.shift = 2, code = "decrypt")

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