R/encrypt.R
encrypt.Rd
Encrypt a data frame or tibble column using an RSA public/private key
encrypt(.data, ..., public_key_path = "id_rsa.pub", lookup = FALSE, lookup_name = "lookup", write_lookup = TRUE)
.data | A data frame or tibble. |
---|---|
... | The unquoted names of columns to encrypt. |
public_key_path | Character. A quoted path to an RSA public key created
using |
lookup | Logical. Whether to substitute the encrypted columns for key-column of integers. |
lookup_name | Character. A quoted name to give lookup table and file. |
write_lookup | Logical. Write a lookup table as a .csv file. |
The original dataframe or tibble with the specified columns encrypted.
# This will run: # genkeys() # gp_encrypt = gp %>% # select(-c(name, address1, address2, address3)) %>% # encrypt(postcode, telephone) # For CRAN and testing: library(dplyr)#> #>#>#> #>#>#> #>#> Private key written with name '/tmp/RtmpoFe9u2/id_rsa2' #> Public key written with name '/tmp/RtmpoFe9u2/id_rsa2.pub'