caesar (version 1.1.0)

seed_cipher: Encrypt and decrypt text using pseudorandom number generation based on the seed set.

Description

Encrypt and decrypt text using pseudorandom number generation based on the seed set.

Usage

seed_cipher(text, seed = 64, decrypt = FALSE)

Arguments

text

String to be ciphered or deciphered.

seed

A single number to set the seed which will pseudorandomly rearrange the original characters

decrypt

If TRUE (not default), deciphers the coded text.

Value

String of the ciphered/deciphered text

Examples

Run this code
# NOT RUN {
seed_cipher("Cowards die many times before their deaths")
seed_cipher("'Ced<,#G,QhG$dXoG/Q$h#G+h(C<hG/0hQ<G,hd/0#",
            decrypt = TRUE)

seed_cipher("Men willingly believe what they wish.",
             seed = 2354)
seed_cipher("q39l*D66D9;6.l%36D3d3l*<p4l4<3.l*D <h",
            seed = 2354,
            decrypt = TRUE)

seed_cipher("the valiant never taste of death but once.",
            seed = -100)
seed_cipher("*QDc3f>efk*ckD3D{c*fu*DcS'c]Df*Qcy%*cSkoDi",
            seed = -100,
            decrypt = TRUE)
# }

Run the code above in your browser using DataCamp Workspace