Skip to content
πŸ”‘ Password protected markdown html reports in R using libsodium
HTML Other
  1. HTML 99.7%
  2. Other 0.3%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
devel
docs
inst
man
.Rbuildignore
.gitignore
DESCRIPTION
LICENSE
LICENSE.md
NAMESPACE
README.Rmd
README.md
encryptedRmd.Rproj

README.md

lifecycle

Password protected html markdown documents

Self-encrypt html markdown reports using sodium. The goal is to provide functionality to password protect markdown html documents and share them with others securely. The code needed to decrypt the file is bundled into the exported html file, which makes the resulting file fully self contained.

** EXPERIMENTAL **

Installation

remotes::install_github("dirkschumacher/encryptedRmd")

Functions

Encrypt html files

library(encryptedRmd)
encrypt_html_file("devel/example/test.html", output_path = "docs/test.encrypted.html")
#> The key to your file is: ada31d24f01015d9a02718a98169a547e5f3369346d02c66d4f9ccb60d305527
#> Your file has been encrypted and saved at docs/test.encrypted.html

You can take a look at the exported file here and use the key printed above to decrypt it.

Encrypted rmarkdown html format

---
title: "test"
output: encryptedRmd::encrypted_html_document
---

See here for an example. After knitting, the document is encrypted with a random key and the file is stored in the same directory together with the key.

Inspiration

Inspired and based on the work by @derhuerst on self encrypting html pages.

Development

In devel/r-encrypted-html-template the code to generate the javascript file is contained. In order to update the template, you have to run the following:

  • In devel/r-encrypted-html-template run npm run build. This creates a new version of the template and copies it to devel/html-template.js. It also creates a file called JSLICENSES.txt that contains all licenses of used node packages.
  • In devel run combine.R. This generates the file report template and copies it to inst/html-template.html. This template is then used within the R package to generate encrypted html files.
You can’t perform that action at this time.