The first step for the encryptr workflow is to create a pair of encryption keys. This uses the openssl package. The public key is used to encrypt information and can be shared. The private key allows decryption of the encrypted information. It requires a password to be set. This password cannot be recovered if lost. If the file is lost or overwritten, any data encrypted with the public key cannot be decrypted.

genkeys(private_key_name = "id_rsa",
  public_key_name = paste0(private_key_name, ".pub"))

Arguments

private_key_name

Character string. Do not change default unless good reason.

public_key_name

Character string. Do not change default unless good reason.

Value

Two files containing the public key and encrypted private key are written to the working directory.

See also

encrypt decrypt

Examples

# Function can be used as this: # genkeys() # For CRAN purposes and testing temp_dir = tempdir() genkeys(file.path(temp_dir, "id_rsa3"))
#> Private key written with name '/tmp/RtmpoFe9u2/id_rsa3' #> Public key written with name '/tmp/RtmpoFe9u2/id_rsa3.pub'