Skip to content

Instantly share code, notes, and snippets.

@lager1
Forked from atifaziz/Unprotect-ProtectedData.ps1
Created February 6, 2020 20:21
Show Gist options
  • Save lager1/7a9a4fb563cae152ae0843b13b42c940 to your computer and use it in GitHub Desktop.
Save lager1/7a9a4fb563cae152ae0843b13b42c940 to your computer and use it in GitHub Desktop.
Decrypting DPAPI-protected Base64 data from PowerShell
Add-Type -AssemblyName System.Security;
[Text.Encoding]::ASCII.GetString([Security.Cryptography.ProtectedData]::Unprotect([Convert]::FromBase64String((type -raw (Join-Path $env:USERPROFILE foobar))), $null, 'CurrentUser'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment