base64 Study Notes

base64 is a tool for encoding binary data into plain text, and optionally decoding it back.


Encoding

Encoding a file as input:

base64 file.txt

Encode from Standard input:

base64

-d, --decode (Decoding)

Change the mode of operation, from the default of encoding data, to decoding data. Input is expected to be base64 encoded data, and the output will be the original data.


-i (ignore)

ignore invalid characters during decoding. Useful when:

  • data is corrupted
  • data contains whitespace or noise