0

I have this string encoded and compressed (link to full string)

78DAED5DCD72A34610BEA72AEFD0A553725804C3AFB6EC5410425EAA242058767C65256A57556BE1E09FBDE4AD9C532EBB76E287F0BEC6BE40D00F96BDB69761A4C1407AAA5C1620ABFB63FAFB663C9A
(...)

And I know that (unencoded and uncompressed) is like this (link to full string):

<XML>
  <PAGINA NUMERO="0">
    <COPIA NUMERO="1">
      <LINEA NUMERO="1">
        <CAMPO NOMBRE="" POS="3" COMP="EXP" NEGR="NO" SUBR="NO" CBAR="NO" ALTOBAR="0">ORDEN DE PAGO: 
(...)

I'm guessig it's compressed and then B64 encoded? I just can't seem to go from one file to the other...

3

Base64 or HEX encoded?

Hex. Base64 would show upper and lower characters as well as +, /, and =. This simply shows numbers and a single case of characters (implying case doesn't matter).

Assuming it's hex, you can decode it down to a binary data file using xxd:

$ xxd -r -p < encoded.txt > encoded.raw

And once you've done that you can use 'file' to guess at what it is:

$ file encoded.raw
encoded.raw: zlib compressed data

So, yes, compressed with zlib. You can try to unzip it, only to fail:

$ gzip -d < encoded.raw

gzip: stdin: not in gzip format

Fortunately, U&L Stack Exchange provides this answer:

$ printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" |cat - encoded.raw |gzip -dc
<XML>

  <PAGINA NUMERO="0">
    <COPIA NUMERO="1">
      <LINEA NUMERO="1">
....
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.