R Password protect .rdata datafile
Asked Answered
A

1

6

I'm trying to protect some datafiles I save in R. Is there a way to password protect an R datafile (.Rdata) ?

Thank you

Annecorinne answered 17/6, 2016 at 20:45 Comment(4)
I suggest to place/mount it on a volume that is encrypted and most operating systems will prompt you for a passsword. There once was a thread on comp.lang.r.generalyou find the short thread here Sourcing encrypted filesJablon
I haven't used this, but it looks promising: github.com/hadley/secureAllfired
An encrypted volume is better than nothing but still an evil admin who knows the volume encryption secret can decrypt the data file (e. g. from a backup tape).Inflorescence
To store the credentials there is now a good package at CRAN: secret cran.r-project.org/package=secretInflorescence
C
2

You can make a call to GnuPG for it to encrypt the file using public key cryptography after you create it in the same script. This would allow additionally for you to share the encrypted files with others without sharing your password.

More on GnuPG: https://www.gnupg.org/gph/en/manual.html

Though I would personally pipe shell commands to encrypt the file rather than using a third party tool/package, there is a gpg package on cran: https://cran.r-project.org/web/packages/gpg/index.html

Cupulate answered 11/11, 2016 at 8:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.