decrypt_dpapi_pw: Decrypt passwords encrypted with the Microsoft Data...

Description Usage Arguments Details Value Examples

View source: R/decrypt_dpapi_pw.R

Description

Decrypt passwords encrypted with the Microsoft Data Protection API

Usage

1

Arguments

file

File that holds a password encrypted using DPAPI

Details

Requires Powershell to be installed and execution policy set to RemoteSigned. This can be achieved by running Set-ExecutionPolicy RemoteSigned from Powershell.

Value

An decrypted password as an invisible string. Invisible means that the password won't be displayed in the console, but can be assigned to a variable or used inline.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# First run the command below from Powershell:
# Read-Host "PW?" -AsSecureString |  ConvertFrom-SecureString | Out-File "C:\Temp\Password.txt"
# Now execute the following R commands to decrypt the password and save it in
# variable "x".  Note that if run without assignment, the password will not
# be displayed in the console.  Passwords must be saved to a variable or used
# inline within a connection string.
library("keyringr")
x <- decrypt_dpapi_pw("C:\\Temp\\Password.txt")

# function is best used in a connection string command:
ch <- odbcConnect("some dsn", uid = "user1", pwd = decrypt_dpapi_pw("C:\\Temp\\Password.txt"))

## End(Not run)

keyringr documentation built on May 2, 2019, 9:17 a.m.