Learn R Programming

EQUALencrypt (version 0.1.0)

EQUAL_perform_file_encryption: Wrapper function for file encryption

Description

"A wrapper function which takes the user input obtained via the Rshiny app, generates a set of private and public encryption keys using the EQUAL_encrypt_generate_keys() function, encrypts a file using the EQUAL_encrypt_file() function, and inserts digital signature on the encrypted file using the EQUAL_insert_signature_file() function."

Usage

EQUAL_perform_file_encryption(rv, server_address = tempdir())

Value

"

html_message

message to the user which includes whether the encryption was successfully performed

"

encrypted_file_path

path to the encrypted file

Arguments

rv

A list supplied by EQUAL-STATS application based on user input

server_address

default address is tempdir(). If a different address is provided, a local copy of the file uploaded for encryption is retained.

Author

Kurinchi Gurusamy

References

https://sites.google.com/view/equal-group/home

See Also

EQUAL_encrypt_file() EQUAL_insert_signature_file()

Examples

Run this code
# Data ####
data <- lapply(1:3, function(x) {
  mean = sample(1:100, 1, replace = FALSE)
  sd = sample(1:100, 1, replace = FALSE)
  rnorm(100, mean = mean, sd = sd)
})
data <- do.call(cbind.data.frame, data)
colnames(data) <- paste0("v", formatC(1:3, width = 6, flag = "0"))
test_file <- write.csv(data, paste0(tempdir(), "/test.csv"), row.names = FALSE,
na = "")
# Simulated rv list ####
rv <- {list(
  file_upload_encrypt = cbind.data.frame(datapath =
  paste0(tempdir(), "/test.csv"))
  )}
# Perform the test ####
results <- EQUAL_perform_file_encryption(rv, server_address = tempdir())

Run the code above in your browser using DataLab