library("lockbox")
# Encrypt with public key
<- string_encrypt(c("secret1", "secret2"), public = "age1xyz...")
encrypted
# Encrypt with passphrase (will prompt)
<- string_encrypt("my secret")
encrypted
# Encrypt with armor
<- string_encrypt("secret", public = "age1xyz...", armor = TRUE) encrypted
Encrypt strings using age
Description
Encrypts one or more strings using the age encryption tool. Can encrypt with public keys (for key-based encryption) or with a passphrase (when no public keys provided). If no public keys are specified, will prompt for a passphrase interactively.
Usage
string_encrypt(input = NULL, public = NULL, armor = FALSE)
Arguments
input
|
Character vector of strings to encrypt |
public
|
Character vector of age public keys (recipients). If NULL, will use passphrase encryption and prompt for password. |
armor
|
Logical, whether to use ASCII armor format (only applies to public key encryption) |
Value
Character vector of encrypted strings