> For the complete documentation index, see [llms.txt](https://oscp.adot8.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oscp.adot8.com/cool/decrypting-secure-strings.md).

# Decrypting Secure Strings

<figure><img src="/files/wrmqIkRfph4Q3J4klGyT" alt=""><figcaption></figcaption></figure>

```
echo "01000000d08c9ddf0115d1118c7a00c04fc2..." > cred.txt
$pw = Get-Content cred.txt | ConvertTo-SecureString
$bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pw)
$UnsecurePassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr)
$UnsecurePassword
```

{% hint style="info" %}
Should convert the secure string to plaintext
{% endhint %}
