Search found 112 matches

by jsira2003@yahoo.com
Sun Jan 27, 2019 7:56 pm
Forum: Windows PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 4425

Re: GetNetworkCredential difficulties

I tried this:

$Secure2 = $aline | ConvertTo-SecureString -Key ($key) -debug

This is what I got

Exception calling .ctor with 2 argument(s): 'cannot process argument basuse the value of the argument "password" is null. change the value of argument "password" to a non-null value.

John
by jsira2003@yahoo.com
Sun Jan 27, 2019 7:49 pm
Forum: Windows PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 4425

Re: GetNetworkCredential difficulties

I have changed all instances of the key to be the byte array. It appears that the array without the byte cast worked the same as with the byte cast.

John
by jsira2003@yahoo.com
Sun Jan 27, 2019 7:46 pm
Forum: Windows PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 4425

Re: GetNetworkCredential difficulties

[byte[]]$global:LilHash1 = (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)

This isn't my actual key but you get the idea.

I used values from 0 - 255. Not the 1-32 as I have shown. I have put 32 values in the parenthesis.

John
by jsira2003@yahoo.com
Sun Jan 27, 2019 7:28 pm
Forum: Windows PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 4425

Re: GetNetworkCredential difficulties

I still can't get over works in ise and not packaged. That doesn't make sense. The logic is the same, however the environment is different.
by jsira2003@yahoo.com
Sun Jan 27, 2019 7:13 pm
Forum: Windows PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 4425

Re: GetNetworkCredential difficulties

Well as it turns out type [byte[]] array didn't change the outcome. I recreated by key file and put it where expected.

John
by jsira2003@yahoo.com
Sun Jan 27, 2019 6:59 pm
Forum: Windows PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 4425

Re: GetNetworkCredential difficulties

I'll use 32 bytes.
by jsira2003@yahoo.com
Sun Jan 27, 2019 6:58 pm
Forum: Windows PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 4425

Re: GetNetworkCredential difficulties

[Byte[]]$key = (200,48,29,36,41,100,7,9)
$key.GetType()

I will change it to this and see what happens.

John
by jsira2003@yahoo.com
Sun Jan 27, 2019 6:23 pm
Forum: Windows PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 4425

Re: GetNetworkCredential difficulties

Excuse my lack of knowledge, I fail to see how the byte size of the data is padded properly. How does this make the character fill correct? I see how you specify your key size. That is all i see. # generate a custom key with correct length $keyLength = 16 # valid values are 16,24,32 $EncryptKey = [b...
by jsira2003@yahoo.com
Sun Jan 27, 2019 6:17 pm
Forum: Windows PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 4425

Re: GetNetworkCredential difficulties

$Key = [system.Text.Encoding]::UTF8.GetBytes('1234561234567890')

as opposed to

$key = (200,45,10,...)

I'm not sure how I'd represent what I wrote as above. Is it necessary to represent the byte array that way? I think utf8 is specifying a font. I'm trying to wrap my head around it.

John
by jsira2003@yahoo.com
Sun Jan 27, 2019 6:11 pm
Forum: Windows PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 4425

Re: GetNetworkCredential difficulties

I think my error was that the size of the text I was encrypting did not have the correct byte count. That makes sense according to the error message invalid padding.

John