safer (version 0.1.0)

encrypt_string: Encrypt a string

Description

encrypt_string encrypts a string as a string and decrypt_string decrypts the encrypted string(encrypted using encrypt_string)

Usage

encrypt_string(string, key = "pass", method = "symmetric")

Arguments

string

A string(character vector of length 1) without embedded NULL to be encrypted

key

A string without embbeded NULL. Default is 'pass'

method

Currently, a stub. It should be 'symmetric'(default)

Value

An encrypted string

Examples

Run this code
# NOT RUN {
temp <- encrypt_string("hello, how are you", key = "secret")
all(
  is.character(temp)
  , decrypt_string(temp, "secret") == "hello, how are you"
  , class(try(decrypt_string(temp, "nopass"), silent = TRUE)) == "try-error")

# }

Run the code above in your browser using DataCamp Workspace