[R] Password Protection of Data Files and R Code (Was: Fw: Re: Why "\\" instead of simple "/" to specify a file path [modified])

Marc Schwartz marc_schwartz at me.com
Mon Mar 22 22:43:11 CET 2010

You need to specify more detail on your functional requirements relative to protection. R itself does not support the direct use of encrypted data or R source files.

If you simply want to encrypt/decrypt files before and after use in R, you can use third party programs such as GnuPG (http://www.gnupg.org/) or commercial equivalents.

However, once the file/data is in memory (RAM) during an R session, it may be written to a tmp or swap partition on the disk by R itself or by the OS, in which case, it will be available 'in the clear' to someone else with physical access to your computer.

If this is a concern, then you want to look a whole disk/volume encryption programs that protect your entire disk and require a password at system boot or during the mounting of an encrypted disk/partition. The details of this will depend upon the OS. For example on higher end Windows systems, there is BitLocker, on Linux there is DM-Crypt/LUKS and on OSX there is FileVault. There are also third party applications such as TrueCrypt, PGP Desktop/WDE (which I use on OSX) and WinMagic, which are available on multiple operating systems.

In the second scenario, everything on the physical disk is encrypted and the reading and writing of these files, which includes the decryption and encryption, is done transparently during disk I/O. Thus, there is no need to manage individual files.

Each of these approaches have pros and cons relative to security, the impact on operating procedures and to some extent, system performance.

There was also a thread covering related matter back in late 2007:


In the future, with a significant subject matter change like this, please start a new thread.


Marc Schwartz

On Mar 22, 2010, at 3:53 PM, Ron Michael wrote:

> Hi, I was following this thread and would like to ask is there any way to save and open a .RData file after using some Password. What I mean to say, how to make my workplace password-protected?
> Also would like to know how same can be done for .R file.
> Thanks for your time.
> Thanks and regards,


More information about the R-help mailing list