encryption: Encrypt and Decrypt Private Datasets

Description Usage Arguments Details Functions Examples

Description

Use the functions hide and unhide to encrypt and decrypt data.

Usage

1
2
3
4
5
hide(obj, pubkey)

unhide(hidden_obj, privatekey)

keychain()

Arguments

obj

An object to hide using secure encryption

pubkey

A public key used to encrypt data with the function hide

hidden_obj

A hidden object to decrypt ('unhide')

privatekey

A private key that is used to decrypt data

Details

hide will utilize public/private key encryption functionality provided by the package sodium. The public key is stored locally with this package's files. In order to decrypt the output of hide, the function unhide will authenticate through an external deployR server. Decryption requires an interactive environment when the user runs for the first time as credentials (username + password) are saved locally thereafter.

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# The function keychain creates a private key,
# then uses it to generate the public key.
# Both are returned in a named list.
keys <- keychain()

keys.public  <- keys$pubkey    # pubkey is used for Encryption
keys.private <- keys$privkey   # privkey is used for Decryption

## example of encryption
##
hiddenObj <- hide("hello world", keys.public)
hiddenObj

# unhide will decrypt and deserialize a hidden object
unhide(hiddenObj, keys.private)

bfatemi/hider documentation built on May 12, 2019, 7:26 p.m.