Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dirkschumacher/encryptedrmd
🔑 Password protected markdown html reports in R using libsodium
https://github.com/dirkschumacher/encryptedrmd
encryption libsodium r sodium
Last synced: about 1 month ago
JSON representation
🔑 Password protected markdown html reports in R using libsodium
- Host: GitHub
- URL: https://github.com/dirkschumacher/encryptedrmd
- Owner: dirkschumacher
- License: other
- Created: 2019-04-27T08:17:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T03:40:17.000Z (almost 2 years ago)
- Last Synced: 2024-10-28T03:39:50.487Z (about 2 months ago)
- Topics: encryption, libsodium, r, sodium
- Language: HTML
- Homepage:
- Size: 13.2 MB
- Stars: 168
- Watchers: 10
- Forks: 5
- Open Issues: 12
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
---
output: github_document
---```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/encryptedRmd)](https://CRAN.R-project.org/package=encryptedRmd)
[![R build status](https://github.com/dirkschumacher/encryptedRmd/workflows/R-CMD-check/badge.svg)](https://github.com/dirkschumacher/encryptedRmd/actions)# Password protected html markdown documents
Self-encrypt html markdown reports using [libsodium](https://doc.libsodium.org/). 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!*
## Installation
``` r
install.packages("encryptedRmd")
`````` r
remotes::install_github("dirkschumacher/encryptedRmd")
```## Functions
### Encrypt html files
```{r}
library(encryptedRmd)
encrypt_html_file("devel/example/test.html", output_path = "docs/test.encrypted.html")
```You can take a look at the exported file [here](https://dirkschumacher.github.io/encryptedRmd/test.encrypted.html) and use the key printed above to decrypt it.
### Encrypted `rmarkdown` html format
```yml
---
title: "test"
output: encryptedRmd::encrypted_html_document
---
```See [here](https://github.com/dirkschumacher/encryptedRmd/tree/master/devel/example) 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](https://github.com/derhuerst/self-decrypting-html-page).
## License
MIT
## 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.