affine {ciphertext} | R Documentation |
affine
Description
The affine cipher is a monoalphabetic substitutoin cipher, where each letter is enciphered with the function (ax+b) mod 26 (26 is the number of letters in the alphabet)
Usage
affine(word, a, b, encrypt = TRUE)
Arguments
word |
Word or phrase to be encrypted |
a |
First parameter. This value and 26 must be coprime |
b |
Second parameter. Magnitude of the shift |
encrypt |
If 'TRUE' (default), the program ciphers the input word, If 'FALSE', the program decrypts it. |
Value
a string
References
https://en.wikipedia.org/wiki/Affine_cipher
Examples
affine("Hello", 1, -1)
[Package ciphertext version 0.1.1 Index]