Secure string

Welcome Forums General PowerShell Q&A Secure string

This topic contains 1 reply, has 2 voices, and was last updated by

2 years, 11 months ago.

  • Author
  • #48973

    Topics: 7
    Replies: 14
    Points: 11
    Rank: Member

    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

  • #49634

    Topics: 13
    Replies: 4872
    Points: 1,842
    Helping HandTeam Member
    Rank: Community Hero

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

The topic ‘Secure string’ is closed to new replies.