Search found 117 matches

by jsira2003@yahoo.com
Sun Jan 27, 2019 5:59 pm
Forum: PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 12815

Re: GetNetworkCredential difficulties

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

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 5:23 pm
Forum: PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 12815

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 5:17 pm
Forum: PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 12815

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 5:11 pm
Forum: PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 12815

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
by jsira2003@yahoo.com
Sun Jan 27, 2019 4:53 pm
Forum: PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 12815

Re: GetNetworkCredential difficulties

I am encrypting an entire file of anywhere between 6 and 19 lines at most. I will read all your posts! I have my work cut out for me digesting it all.

thank you,
John
by jsira2003@yahoo.com
Sun Jan 27, 2019 10:40 am
Forum: PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 12815

Re: GetNetworkCredential difficulties

This is geared for multiple apps. I embed key in the app for a particular version. The call EncryptUserData $startDate $endDate $textboxuuid.Text $textboxipaddress.Text $Program $version $file The encrypt function Function EncryptUserData([string]$startDate, [string]$endDate, [string]$uuid, [string]...
by jsira2003@yahoo.com
Sun Jan 27, 2019 8:27 am
Forum: PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 12815

Re: GetNetworkCredential difficulties

I reread your email about the byte array begins wrong. I have an array of 32 bytes with values from 0 to 255 e.g.

$global:byteArray = (25, 200, 48, ...)

Is there any problem here?

Thanks,
John
by jsira2003@yahoo.com
Sun Jan 27, 2019 8:01 am
Forum: PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 12815

Re: GetNetworkCredential difficulties

First all let me say I appreciate all your help! I saw the many listing on the web regarding this ugly error. It certainly is ugly. The thing I cannot wrap my head around is the following: It does not work as a packaged app. Yet is work perfectly in ise. As you can see once the function has the file...
by jsira2003@yahoo.com
Sat Jan 26, 2019 1:28 pm
Forum: PowerShell
Topic: GetNetworkCredential difficulties
Replies: 40
Views: 12815

Re: GetNetworkCredential difficulties

I executed my code with your error catching. I will see if I can catch error before packaging as you said in the ps studio. From what I read it seems as if the expected byte counts are off in the Encrypted string.

This is tricky stuff
John