user000
user000

Reputation: 123

How to hide elements in R environment?

I work with an SQL database connecting to it in RStudio, and I am trying to find a way to hide my password from other colleagues for common reasons. I cam across this solution using .rs.askForPassword. However, the created element still shows up in environment in the values area showcasing the password entered on the screen. Is there a way to create it as a hidden object? Or, perhaps, an alternative solution for handling DB passwords altogether?

Upvotes: 0

Views: 452

Answers (2)

user000
user000

Reputation: 123

Thanks to a suggestion by @Wimpel I used Keyring to fix my problem. A little more detailed look into it can be seen here. In short, I used the command rstudioapi::askForSecret directly in SQL server connection setup, so I don't have to create an object containing my password dbConnect(odbc::odbc(), password = **rstudioapi::askForSecret("password")**)

Upvotes: 2

BtecK
BtecK

Reputation: 39

Since you work with sql, have you tried to just simply hash it with SHA1 encryption ?

SHA1(string)

You can also tick an option to hide the values in phpmyadmin thus showcasing it with ***

Upvotes: 0

Related Questions