|
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
[Re: Khaled]
#261981
18/12/17 02:05 AM
|
Joined: Jan 2004
Posts: 1,799
maroon
OP
Hoopy frood
|
OP
Hoopy frood
Joined: Jan 2004
Posts: 1,799 |
so that the key and the salt/iv are chopped at 56 and 8 UTF-8 characters respectively Thanks, but a clarification: I did not mention the UTF-8 issue related to Salt/IV in my latest post, because I did not think $encode handles Salt/IV wrong. The only reason one of my examples used an IV was that an IV was the only way to keep 'cl' from using a random salt, allowing to demonstrate the 'cl' key's UTF-8 behavior in an unchanging vector. Unless you're finding $encode is not handling ASCII 128-255 within IV in a compatible way with OpenSSL, I don't think the Salt/IV need changing. Current behavior is to not UTF-8 encode the IV/Salt into longer byte strings when ASCII 128-255 are used, so I was not finding a length issue there. The red/blue lines show that Salt and IV are not storing ASCII 128-255 into the ciphertext header as UTF-8 byte pairs. The blue/maroon lines show $encode doesn't use a UTF-8 encoded IV internally either, or else blue/maroon would not have matching ciphertexts. Matching ciphertexts could not happen if maroon's IV is full of UTF-8 byte pairs while the binary plaintext contains 8 identical bytes. I assume the switch "s" Salt is handled the same way as IV internally, but I couldn't verify without knowing how $encode hashes the key and Salt together. (Bump for my feature request to permit defining key/salt/iv as binary variables using capital switches KSI.) alias test_ivsalt {
var %data8 abc $+ $chr(233) $+ $chr(233) $+ def | echo -a iv/salt for red/green is %data8
bset -t &data1 1 BLOWFISH1234567 | noop $encode(&data1,bmcri,key,%data8) | noop $decode(&data1,bm) | echo 3 -a As Text: $bvar(&data1,1-).text | echo 3 -a Len $bvar(&data1,0) Bytes: $bvar(&data1,1-)
bset -t &data2 1 BLOWFISH1234567 | noop $encode(&data2,bmcs ,key,%data8) | noop $decode(&data2,bm) | echo 4 -a As Text: $bvar(&data2,1-).text | echo 4 -a Len $bvar(&data2,0) Bytes: $bvar(&data2,1-)
var %asc 116
var %xor1 000 | var %iv1 $str($chr($xor(%asc,%xor1)),8)
var %xor2 157 | var %iv2 $str($chr($xor(%asc,%xor2)),8)
bset -c &data1 1 $str($xor(%asc,%xor1) $chr(32),8) $str(a $chr(32),7) | echo 2 -a XOR by %xor1 Data: $bvar(&data1,1-) IV: %iv1 | noop $encode(&data1,bmcri,key,%iv1) | noop $decode(&data1,bm) | echo 2 -a As Text: $bvar(&data1,1-).text | echo 2 -a Len $bvar(&data1,0) Bytes: $bvar(&data1,1-)
bset -c &data2 1 $str($xor(%asc,%xor2) $chr(32),8) $str(a $chr(32),7) | echo 5 -a XOR by %xor2 Data: $bvar(&data2,1-) IV: %iv2 | noop $encode(&data2,bmcri,key,%iv2) | noop $decode(&data2,bm) | echo 5 -a As Text: $bvar(&data2,1-).text | echo 5 -a Len $bvar(&data2,0) Bytes: $bvar(&data2,1-)
}
|
|
|
Entire Thread
|
Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
07/12/17 07:46 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
Khaled 
|
17/12/17 09:03 AM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
17/12/17 12:30 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
Khaled 
|
17/12/17 05:22 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
18/12/17 02:05 AM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
Khaled 
|
18/12/17 05:29 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
24/12/17 06:33 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
Khaled 
|
29/12/17 10:18 AM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
05/01/18 04:26 AM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
Khaled 
|
07/01/18 05:34 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
06/03/19 10:07 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
21/03/19 09:51 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
28/03/19 09:59 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
Khaled 
|
29/03/19 11:51 AM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
12/04/19 04:58 AM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
12/04/19 06:39 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
Khaled 
|
13/04/19 08:02 AM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
Raccoon
|
13/04/19 11:16 AM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
13/04/19 11:46 AM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
Khaled 
|
14/04/19 12:00 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
14/04/19 10:59 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
25/04/19 06:11 AM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
Khaled 
|
27/04/19 10:22 AM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
Khaled 
|
29/03/19 12:16 PM
|
Re: Invalid key lengths in $encode(data,<e[l]|cl>,key)
|
maroon
|
31/03/19 10:57 PM
|
|
|
|
|
|
|