1

How is secure string encrypted? I've read that it uses DPAPI, but what if I'm using AsPlainText? Does it still uses DPAPI?

1 Answer 1

2

The article you linked to starts its second paragraph with:

The ConvertFrom-SecureString and ConvertTo-SecureString cmdlets, when you don’t use their -Key, -SecureKey, or -AsPlainText switches, use DPAPI to encrypt / decrypt your secret data.

So no, if you use -AsPlainText it is not encrypted and doesn't use DPAPI.

When it is encrypted, the key is specific to the user and computer on which you've done the encryption.

According to the ConvertFrom-SecureString documentation, if you use -Key or -SecureKey, then AES is used. As for how DPAPI encrypts data, have a look at this MSDN article about Windows Data Protection. One of its points says:

It uses proven cryptographic routines, such as the strong Triple-DES algorithm in CBC mode, the strong SHA-1 algorithm, and the PBKDF2 password-based key derivation routine.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I was wondering how that was done. Is it still 3DES? And what information from the user and computer is obtained?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.