How to get hexadecimal blocks from a base encoded string?

In this article and this XKCD , they both display the password data as a group of hexadecimal.

However, the file is encoded base64. What can I use to match pins with bash scripting? I tried:

echo -n "7WkoOEfwfTTioxG6CatHBw==" | base64 -d echo -n "7WkoOEfwfTTioxG6CatHBw==" | openssl enc -d -base64 

What do they do and how to decode them into hexadecimal blocks?

xkcd encryptic

+6
source share
1 answer

If I understand this correctly, I think the requirement is to convert a base64 encoded string to a hexadecimal string in blocks of 8 bytes (16 hexadecimal digits). If so, od -t x8 , after basic decoding you will like it most:

  $ echo -n "7WkoOEfwfTTioxG6CatHBw ==" |  base64 -d |  od -t x8 |  cut -s -d '' -f2-
 347df047382869ed 0747ab09ba11a3e2
 $ 
+11
source

Source: https://habr.com/ru/post/957606/


All Articles