Objective
Base64 represents any bytes with 64 printable characters, so they can be sent through channels that only accept text (email, JSON, URLs). It is not encryption: anyone can decode it.
Instructions
- The first line has the number
nof commands; each one isenc text(encodes the text in UTF-8) ordec base64(decodes). - Show the result. If the base64 string is not valid or does not represent UTF-8 text, show
Error: invalid base64. Decode withvalidate=True.
3
enc hola mundo
dec aG9sYQ==
dec !!!
aG9sYSBtdW5kbw==
hola
Error: invalid base64
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise