Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - SecureString : Using -key

Reply
 
Old 08-13-2007   #1 (permalink)
dm_14


 
 

SecureString : Using -key

If I do this on my PC
$s = Read-Host -assecurestring
$s = ConvertFrom-SecureString $s -key(1..16)
$s > test.cfg

and then to this on another PC
$s = convertto-securestring (get-content test.cfg) - key (1..16)


The first 7 characters appears as ??????? followed by the rest of the string.
The same statement on the PC used to create the test.cfg file appears correct.

I used the -encoding option with out-file but have the same results.

Could anyone shed some light on this ? don't know whats going wrong. Thanks

My System SpecsSystem Spec
Old 08-14-2007   #2 (permalink)
Desmond Lee


 
 

RE: SecureString : Using -key

dm_14,

I tested this on Win XP SP2 and the hash secured string is returned, not
???????. Which platform are you using for the 2 systems you mentioned?

--
............... All new, all fresh ..............
http://www.leedesmond.com/weblog/


"dm_14" wrote:

> If I do this on my PC
> $s = Read-Host -assecurestring
> $s = ConvertFrom-SecureString $s -key(1..16)
> $s > test.cfg
>
> and then to this on another PC
> $s = convertto-securestring (get-content test.cfg) - key (1..16)
>
>
> The first 7 characters appears as ??????? followed by the rest of the string.
> The same statement on the PC used to create the test.cfg file appears correct.
>
> I used the -encoding option with out-file but have the same results.
>
> Could anyone shed some light on this ? don't know whats going wrong. Thanks

My System SpecsSystem Spec
Old 08-15-2007   #3 (permalink)
dm_14


 
 

RE: SecureString : Using -key

Demond,

The encrypted string was created on a WinXP pc and the decryption occurs on
Win2003 server. If I perform both the encryption and decryption on the same
WinXP pc I get the correct secured string the same as you.

I tried several times between the server and the WinXP PC and each time the
first seven characters appear as ???????, all text past it appears correctly.
I got round it by creating the encrypted string on the Win2003 server and
that worked fine on the server.

But I still don't know why it shouldn't work between the PC and server.

Any thoughts ?

"Desmond Lee" wrote:

> dm_14,
>
> I tested this on Win XP SP2 and the hash secured string is returned, not
> ???????. Which platform are you using for the 2 systems you mentioned?
>
> --
> .............. All new, all fresh ..............
> http://www.leedesmond.com/weblog/
>
>
> "dm_14" wrote:
>
> > If I do this on my PC
> > $s = Read-Host -assecurestring
> > $s = ConvertFrom-SecureString $s -key(1..16)
> > $s > test.cfg
> >
> > and then to this on another PC
> > $s = convertto-securestring (get-content test.cfg) - key (1..16)
> >
> >
> > The first 7 characters appears as ??????? followed by the rest of the string.
> > The same statement on the PC used to create the test.cfg file appears correct.
> >
> > I used the -encoding option with out-file but have the same results.
> >
> > Could anyone shed some light on this ? don't know whats going wrong. Thanks

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
SecureString in Batch PowerShell
Using SecureString objects PowerShell
HowTo: Use ConvertTo-SecureString and ConvertFrom-SecureString PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46