I need to input username and password in an R code without values being shown in console. I am encrypting the variables to ensure it is not visible in the variable list. As I need to demo the code it is not helpful if the password pops up in the console. Can it be replaced by # or * for security for the demo
key <- PKI.genRSAkey(2048)
uid <- PKI.encrypt(charToRaw(readline("Enter userID: ")), key)
pwd <- PKI.encrypt(charToRaw(readline("Enter Password: ")), key)
drv <- JDBC(driverClass="org.netezza.Driver", classPath = "C:/JDBC/nzjdbc.jar", "'")
conn <- dbConnect(drv, "jdbc:netezza://netezzaprd01:5480/SDSNZD10", rawToChar(PKI.decrypt(uid, key)), rawToChar(PKI.decrypt(pwd, key)))
Any help appreciated. Thanks