Description Usage Arguments Details Value Examples
Encrypt or decrypt character string
1 2 3 4 5 6 7 |
text |
Character string or raw vector to encrypt or character string to decrypt |
key |
Character string with encryption/decryption key.
Only the letters (in upper or lower case), digits, the character |
ed |
Character ( |
trans |
Character string with encrypt/decrypt operations. See Details |
noe |
Logical scalar that when set to |
Operations in trans
are sequentially executed in the order given for an encrypt
action and in reversed order for the decrypt action.
All operations are working on character strings that contain a multiple of 16 characters.
These characters must belong to the ordered set of the lower case letters, the
upper case letters, digits, the space and the #
character. This order is changed by the key:
all (non-duplicated) characters from the key are placed before the other characters.
To ensure that all characters belong to this ordered set,
an e
operation is always added (prefixed) to trans
unless noe = TRUE
is used.
When noe
is set to TRUE
the user must ensure that the string to be encrypted
only contains the characters mentioned above and that the number of characters is
a multiple of 2 when the p
or s
operation is used and a multiple of 16 when the a
operation is used.
The following operations are defined (we describe only what happens in case of encryption because for decryption the reversed action is performed):
e : encode all characters that are not a blank, a letter or a digit and ensure that the length of the resulting string is a multiple of 16
s : shuffle the characters in such a way that 0123456789abcdef
is translated to 0f2d4b6987a5c3e1
f : flip the characters in such a way that 0123456789abcdef
is translated to fedcba9876543210
v : a Vigenère translation based on the key: the x-th character is shifted in the ordered set based on the position of the x-th character in the ordered set.
c : a Vigenère translation based on the first character of the ordered set for the first character and from then on based on the result for the preceding character.
p : a Playfair translation based on an 8x8 square filled with the ordered set. This handles 2 consecutive characters
a : an AES translation based on the key. This is in fact the digest::AES()
function with mode='ECB'
h : a Hill linear transformation based on the key. This handles 4 consecutive characters
a character string with the encrypted result when ed == 'e'
or
the decrypted result when ed == 'd'
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.