Self-encrypt html markdown reports using libsodium. The package lets you 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.
Use at your own risk. Feedback and bug reports very welcome!
install.packages("encryptedRmd")
remotes::install_github("dirkschumacher/encryptedRmd")
library(encryptedRmd)
encrypt_html_file("devel/example/test.html", output_path = "docs/test.encrypted.html")
#> The key to your file is: f5c8c13752cf4e8cc59b59e9f96279ceb6836fc8ce957e55e232724dd80c318f
#> 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.
---
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.
Inspired and based on the work by @derhuerst on self encrypting html pages.
MIT
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
runnpm run build
. This creates a new version of the template and copies it todevel/html-template.js
. It also creates a file calledJSLICENSES.txt
that contains all licenses of used node packages. - In
devel
runcombine.R
. This generates the file report template and copies it toinst/html-template.html
. This template is then used within the R package to generate encrypted html files.