# The workflow here does not really lend itself to an example,
# please see the vignette instead.
# First we need a set of user ssh keys. In a non example
# environment your personal ssh keys will probably work well, but
# hopefully they are password protected so cannot be used in
# examples. The password = FALSE argument is only for testing,
# and should not be used for data that you care about.
path_ssh_key <- tempfile()
cyphr::ssh_keygen(path_ssh_key, password = FALSE)
# Initialise the data directory, using this key path. Ordinarily
# the path_user argument would not be needed because we would be
# using your user ssh keys:
path_data <- tempfile()
dir.create(path_data, FALSE, TRUE)
cyphr::data_admin_init(path_data, path_user = path_ssh_key)
# Now you can get the data key
key <- cyphr::data_key(path_data, path_user = path_ssh_key)
# And encrypt things with it
cyphr::encrypt_string("hello", key)
# See the vignette for more details. This is not the best medium
# to explore this.
# Cleanup
unlink(path_ssh_key, recursive = TRUE)
unlink(path_data, recursive = TRUE)
Run the code above in your browser using DataLab