Skip to content

matt-dray/encrypt-rmd-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

encrypt-rmd-test

Project Status: Concept – Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept. rostrum.blog post

Demo of an RMarkdown output that's encrypted and hosted online.

What

I used Dirk Schumacher's {encryptedRmd} R package to render an R Markdown file to encrypted HTML, which I've hosted online via GitHub Pages. It requires a decryption key if you want to download it.

That means I can give the URL and the decryption key to someone and they can download the contents. If you don't have the decryption key, you can't view it.

Read more in the accompanying blog post.

Example

For this demo, you can find the encrypted HTML output here: https://matt-dray.github.io/encrypt-rmd-test/encrypt-test.html.enc.html

You'll be prompted for a key, which for this example is: 9ebf5d40b061c59330b9fce16703e4c2fb2fbf90a773996e43e49d562ea17039

As noted in the {encryptedRmd} README: use at your own risk.

How to

I did the following to create the contents of this repo:

  1. Install {encryptedRmd} from CRAN with install.packages("encryptedRmd") (v0.2.1 at time of writing)
  2. Write an R Markdown file with the output: field in the YAML set to encryptedRmd::encrypted_html_document
  3. Knit the file to render (i) an unencrypted HTML, (ii) an encrypted HTML, and (iii) a decryption key
  4. Commit and push the encrypted file to GitHub and serve it via GitHub Pages (go to 'Settings' > 'Pages' from the GitHub repo)

Of course, you should add the R Markdown file, the unencrypted HTML and the decryption key to your .gitignore. I've retained all the files in this repo for demonstration purposes.

File structure

I created the R Markdown file encrypt-test.Rmd in the docs/ folder of this repo. When knitted, it generated:

  • encrypt-test.html, an unencrypted HTML rendered from the Rmd
  • encrypt-test.enc.html, an encrypted HTML rendered from the Rmd
  • encrypt-test.end.html.key, the key that must be used to decrypt the encrypted HTML

About

🔒📝 Demo: put an encrypted R Markdown file on GitHub Pages

Resources

Stars

Watchers

Forks

Languages