How to store the password in the R script in the package 'Encryptr'?

Asked

Viewed 51 times

5

I did it:

library(encryptr)
genkeys()

And I created the password: 0)]30l^8

password<-"0)]30l^8"
data(gp)
write.csv(gp, "gp.csv")
encrypt_file("gp.csv")

My problem: How to automatically enter the password in decrypt_file("gp.csv.encryptr.bin", file_name = "gp2.csv")

I need this to decrypt many file in a short time.

1 answer

5


It is impossible to do that, at least at the time I am writing this answer. If you go to package page on github, specifically on the part of issues, will see that one of the programmers replied the following on 25 February 2019 (griffins of mine):

Many Thanks for this and the work in the pull request. It is greatly appreciated. Along with some other changes, I have Incorporated your suggestions in the Latest push. All but the option of exposing the password option. This was Designed in this way intentionally to avoid having passwords Written into scripts. This seemed to the team Exactly what we Were trying to avoid. Is there a particular Situation you see in which the password must be included in the script? If there is a good argument we will include. But there are Lots of good reasons not to do this. Many Thanks Again.

Right after, as of 25 February, the same programmer writes the following (my emphasis again):

I Guess I Feel Pretty strongly about not allowing users the option to make a mistake with a password. Together with wanting to go to information governance Authorities and Say we are using a system in which the password is not Recorded in the script.

An Alternative (that may be over thinking it) is to have genkeys_() specifically for Developers that Allows that option, but is not included in the standard package vignettes etc.

Thanks Again for this help and Discussion. I should have said above that I Haven’t Incorporated the tests, but will do with a PR when we conclude this thread.

That is, by choice of the programmers, it is not possible to use the functions of the package with the password written somewhere inside the script. Therefore, unfortunately, it is not possible to do what the question asks.

  • I have been exploring the Encryptr package and discovered that it is a makeup of the openssl package to make it much more user-friendly. I will have to reverse engineer to work directly on openssl.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.