0

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?

user000
  • 123
  • 7

2 Answers2

2

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")**)

user000
  • 123
  • 7
0

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 ***

buddemat
  • 4,552
  • 14
  • 29
  • 49
BtecK
  • 39
  • 7
  • But I still need to see other elements' values. Anyways, ```rstudioapi::askForSecret``` solved the problem. – user000 Nov 10 '21 at 09:01