encrypt.col: Encrypts a column (or columns) from a file, with a given...

View source: R/encrypt.R

encrypt.colR Documentation

Encrypts a column (or columns) from a file, with a given password, generates lookup tables, and zips the tables into an encrypted zip file with the password. Files are (optionally) saved to a timestamped directory, and a timestamped zip file is then (optionally) generated. The data with encrypted ID columns will be saved to the specified path, with the same file name as the original, but

Description

It's your responsibility to securely erase the identifiable data. Use something that specifically overwrites it, your operating system will not do that by default.

Usage

encrypt.col(
  input.file.path,
  col.names,
  password = NULL,
  save.encrypted.table = T,
  save.lookup.table = T,
  save.password = T,
  save.zip = T,
  table.save.dir = NULL,
  lookup.save.dir = NULL,
  encrypted.column.suffix = ".IDencrypted",
  encrypted.file.suffix = "_IDencrypted",
  output.to.console = T
)

Arguments

input.file.path

Character file path readable by data.table::fread

col.names

Character vector of columns to encrypt.

password

The password with which to encrypt. If NULL, the user will be prompted. Probably not best practice to store this unencrypted in scripts. Could maybe move to certificates one day. (Default: NULL)

save.encrypted.table

Save encrypted data as CSV to table.save.path (Default: T)

save.lookup.table

Save lookup tables for each encrypted column (Default: T)

save.password

Save the password in a plain text file (Default: T)

save.zip

Save all generated files in an encrypted ZIP file with same password, this probably requires Rtools, and for the zip function to be in Windows PATH (Default: T)

table.save.dir

Character directory to save table with encrypted data to (Default: same as input)

lookup.save.dir

Character directory to save lookup tables to (Default: same as input)

encrypted.column.suffix

Character to append to original column names to indicate that they are encrypted. (Default: '.IDencrypted')

encrypted.file.suffix

Character to append to original file names to indicate that they are encrypted. (Default: '_IDencrypted')

output.to.console

Say what's going on in the console (Default: T)


mattmoo/daohtools documentation built on Feb. 5, 2023, 5:38 a.m.