Author Posts

August 1, 2016 at 4:55 pm

Hello,
I would like to get a key from the user and store it in registry in a secured way and i would like to retrieve it whenever required to execute a service through PS script.

$PSSecretKey=Read-host -Prompt "Enter Secret-Key" -AsSecureString
$PSEncryptedkey = ConvertFrom-SecureString -SecureString $PSSecretKey

I am storing $PSEncryptedkey in registry and i am trying to retrieve it as a plaintext , but its not happening

  • This topic was modified 2 years ago by  Powershell.

August 8, 2016 at 8:50 pm

So... I guess, if you're planning to store it in clear text in the registry, why are you bothering with SecureString at all?