• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Encryption using secure key


Richard Manion

Hello All,
I am trying to decrypt a string to plain text using an example I found on
/\/\o\/\/'s blog which referenced a post in the news group. I'm doing it like

$strString = convertto-securestring $strString -securekey $strServerKey
$ptrPassword =

$strString =

The intention is that $strString contains the plain text of the string.
(Actually, I don't need this in plain text I just need the securestring to be
correct.) When I do this on the computer I originally encrypted the string
on, it works fine. when I switch computers, the first several characters are
garbage. (They come up as question marks, and they can't be cast as a byte).
I originally encryted the string thusly:
$out = "What is the new password?"
$return = read-host $out -assecurestring
$secure = convertfrom-securestring $return -securekey $strServerKey

I note that there doesn't seem to be a key option in read-host. Can anyone
help me determine the problem here. I've been working on this for days with
no result.

My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)