R/decrypt_data.R

Defines functions decrypt_data

Documented in decrypt_data

#' Decrypt an encrypted .RData file
#'
#' A shiny gadget will pop up so the password can be provided
#'
#' @param fileLocation location of the file
decrypt_data <- function(fileLocation){
  loadIn <- new.env()
  load(fileLocation,envir=loadIn)
  readIn <- get(ls(loadIn),envir=loadIn)

  password <- get_password()
  key <- hash(charToRaw(password))
  return(unserialize(data_decrypt(readIn,key)))
}
OpenSourceMindshare/surveytools documentation built on Aug. 14, 2019, 10:38 a.m.