You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Allow sharing sensitive information, for example passwords, 'API' keys,etc., in R packages, using public key cryptography.
Disclaimer
Although the package authors did what they could to make sure thatthe package is secure and cryptographically sound, they are notsecurity experts.
Memory areas for secrets, user passwords, passpharases, private keys andother sensitive information, are not securely cleaned after use!Technically, the local R process and other processes on the samecomputer, may have access to them. Never use this package on a publiccomputer or any system that you don't trust. (Actually, never typing inany password on a public computer is good security practice, in general.)
Use this package at your own risk!
Installation
Install the package from CRAN:
install.packages("secret")
Usage
Load the package:
library(secret)
Set up your keys:
Ensure you know the location of your public and private keys. In Linux this is usually the folder~/.ssh, so on Windows you may want to choose the same folder.
By default, the package looks for your private key at
~/.ssh/id_rsa
~/.ssh/id_rsa.pem.
You can change this default by setting an environment variableUSER_KEY:
# This is optional - only do this if you want to change the default locationSys.setenv(USER_KEY="path/to/private/key")
Test that the package can read your key. This might fail if you don't have a key at~/.ssh/id_rsa, or if your private key has a pass phrase and R in running in non-interactive mode.
If you use windows, you most likely created your keys using PuttyGen. Note that the key created by default from PuttyGen is not in OpenSSH format, so you have to convert your format first. To do this, use the/Conversions/Export OpenSSH key menu item in PuttyGen.
Note that the folder~/.ssh in Windows usually expands toC:\\Users\\YOURNAME\\Documents\\.ssh. You can find the full path by using: