'How do I get hex blocks from a base 64 encoded string?

In this article and this XKCD, they both show the password data as groupings of hexadecimal.

However, in the file it's base64 encoded. What could I use to match that output with bash scripting? I've tried:

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

What is it they are doing, and how do I decode them to hex blocks?

xkcd Encryptic



Solution 1:[1]

Output the hex code without newline:

echo "<BASE64>" | base64 -d | hexdump -v -e '/1 "%02x" '

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1