> 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="https://3007503158-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fp6nDpW0GBTPP8pZM4JHQ%2Fuploads%2FkaZTiiUjSrmTHP90gz5x%2Fimage.png?alt=media&amp;token=b8fb5bef-0628-4091-9a0e-8e1ec69b5681" 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 %}
