adfgvx.cipher: ADFGVX Cipher.

Description Usage Arguments Value Examples

View source: R/CIPH-fun.R

Description

A cipher with two transformations: Substitution and Transposition. The original message is replaced by the values inside the ADFGVX square, and then, using a given keyword, the transformed message is rearranged, obtaining a unique set of code.

Usage

1
adfgvx.cipher(ms, key, code)

Arguments

ms

The message to be encrypted/decrypted in a single character object. The Raw message can be written with upper cases and spaces and numbers can be used. The encrypted message needs a space between each five-letter symbol.

key

A single word, necessarily one where no letters are repeated i.e. "Airjet", which determines the unique pattern in which the message is encrypted or decrypted.

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: "Encrypted Message", which is the set of five-letter transformation of the Raw message; and "Null (characters) Values Added", which is the number of characters added into the message - that is because additional letters need to be added to complete the Transposition matrix. For the decrypted message, returns a single character object with the decrypted message.

Examples

1
2
3
adfgvx.cipher(ms = "Hello World 1", key = "Post", code = "encrypt")

adfgvx.cipher(ms = "DXXXA XXAGA DGAXD FAAGD AXGAD AXDFD", key = "Air", code = "decrypt")

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