Convert hexadecimal information to binary using linux command

I have this binary on my Linux system.

udit@udit-Dabba ~ $ cat file.enc Salted__s bO  <0 F   Jw!   ] :`C LKȆ l 

Using the hexdump command, I see its information as follows.

  udit@udit-Dabba ~ $ hexdump -C file.enc 00000000 53 61 6c 74 65 64 5f 5f 1b 73 a1 62 4f 15 be f6 |Salted__.s.bO...| 00000010 3c 30 cc 46 ee 10 13 11 84 bf 4a 77 21 a4 84 99 |<0.F......Jw!...| 00000020 0e 5d ef 11 18 3a 60 43 a0 4c 4b 1e c8 86 e6 6c |.]...:`C.LK....l| 00000030 

Now I am provided with a file on another system, the contents of which are as follows.

  53 61 6c 74 65 64 5f 5f 1b 73 a1 62 4f 15 be f6 3c 30 cc 46 ee 10 13 11 84 bf 4a 77 21 a4 84 99 0e 5d ef 11 18 3a 60 43 a0 4c 4b 1e c8 86 e6 6c 

and I need to find out the exact same binary information from this hexdump.

How to do it?

If there is no switch for this, then the C code will also work fine.

(but linux command with some switch is preferred)

LIMITATION:

The binary information in the file is derived from the encryption algorithm, so the content should exactly match.

+45
c command command-line-arguments binaryfiles hexdump
Oct 19 '11 at 18:52
source share
1 answer

As suggested by @ user786653, use the xxd(1) program:

 xxd -r -p input.txt output.bin 
+71
Oct 19 '11 at 19:12
source share



All Articles