safer (version 0.1.0)

decrypt_string: Decrypt an encrypted string

Description

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

Usage

decrypt_string(encryptedString, key = "pass", method = "symmetric")

Arguments

encryptedString

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

key

A string without embbeded NULL. Default is 'pass'.

method

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

Value

A decrypted 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