I have written an R package that connects to some services requiring username and password.
I want to avoid typing my username and password every time, so I have my package read them from a file encrypted using AES (I use the digest package in a way similar to the answer to this question: How do I read an encrypted file from disk with R)
The AES key is generated when a user installs the package and it is used to encrypt and decrypt the users credentials.
This way the users only need to insert their credentials once at the moment of installation and then do not need to write them in any place in the code.
However if somebody gets access to their laptop, it is very easy for him to decrypt the credentials using the key generated by my package.
Is there any way I can protect the key (possibly in a cross-platform manner, since the package has to be used in Windows, Linux and Mac)?