For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > June 2007 > Re: decrypting encrypted ascii characters









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: decrypting encrypted ascii characters
Stephane CHAZELAS

2007-06-29, 7:06 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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com