| Stephane CHAZELAS 2007-06-29, 7:21 pm |
| 2007-06-29, 14:42(-07), stenasc@yahoo.com:
[...]
> a) library ieee; ....this is the line of text to be
> encrypted
>
> b) ???????? ....after xoring with FFh and reversing
> 00000001h: C4 9A 9A 9A 96 DF 86 8D 9E 8D 9D 96 93 ; ????
> ???? (Hex values)
>
>
>
> Now in Unix, this encrypted code line b) looks like this....
>
> c) ?���?������
>
> 00000012h: C4 9A EF BF BD EF BF BD EF BF BD DF 86 EF BF BD ;
> ?���?�
> 00000022h: EF BF BD EF BF BD EF BF BD EF BF BD EF BF BD ;
> �����
>
> Trying to decrypt line b) by XORing with FFh produces more unreadable
> garbage. Is there any way I can get back from c) to a) or even c) to
> b) ?
>
> Any character set specialists out there that can help, I'd much
> appreciate it.
[...]
Your encryption function works on bytes, there's not reason why
it should have any relationship with charsets or work
differently on different systems.
$ printf 'library ieee;' | PERL -ne 'print pack "C*", reverse
map {$_^0xFF} unpack "C*", $_' | od -tx1
0000000 c4 9a 9a 9a 96 df 86 8d 9e 8d 9d 96 93
0000015
$ printf 'library ieee;' | PERL -ne 'print pack "C*", reverse
map {$_^0xFF} unpack "C*", $_' | PERL -ne 'print pack "C*",
reverse map {$_^0xFF} unpack "C*", $_'
library ieee;
Your c) above is obviously garbage. Only "y " and "e;" are there
from the original string
$ printf 'C4 9A EF BF BD EF BF BD EF BF BD DF 86 EF BF BD EF BF
BD EF BF BD EF BF BD EF BF BD EF BF BD' | PERL -ane 'print pack
"(H2)*",@F' | PERL -ne 'print pack "C*", reverse map {$_^0xFF}
unpack "C*", $_' | od -tc
0000000 B @ 020 B @ 020 B @ 020 B @ 020 B @ 020 B
0000020 @ 020 y B @ 020 B @ 020 B @ 020 e ;
0000037
--
Stphane
|