columnar_transposition {cryptography}R Documentation

Columnar Transposition Cipher

Description

This can be used to encrypt or decrypt a Columnar Transposition cipher. This method is a development of the Scytale cipher that rearranges the encryption matrix used in the Scytale method by the alphabetical ordering of the encryption key.

Usage

columnar_transposition(message, key, encrypt = TRUE)

Arguments

message

A character vector

key

A character vector composed only of a-zA-Z letters used as the encryption key

encrypt

(Default: TRUE) TRUE will encrypt the message, while FALSE will decrypt the message.

Value

A character vector of either plaintext that has been encrypted or ciphertext that has been decrypted using the columnar transposition cryptographic method.

Examples

columnar_transposition("Hidden message", "hack", encrypt = TRUE)
columnar_transposition("insed sHeegdma", "hack", encrypt = FALSE)


[Package cryptography version 1.0.0 Index]