15.8 Using a lookup table

Rather than storing the ciphertext in the working data frame, a lookup table can be used as an alternative. Using lookup = TRUE has the following effects:

  • returns the data frame / tibble with encrypted columns removed and a key column included;
  • returns the lookup table as an object in the R environment;
  • creates a lookup table .csv file in the active directory.

The file creation can be turned off with write_lookup = FALSE and the name of the lookup can be changed with lookup_name = "anyNameHere". The created lookup file should be itself encrypted using the method below.

Decryption is performed by passing the lookup object or file to the decrypt() function.