Base64 is most commonly used to encode binary data (for example, images, or sound files) for embedding into HTML, CSS, EML, and other text documents. In addition, Base64 is used to encode data that may be unsupported or damaged during transfer, storage, or output. Here are some of the applications of the algorithm:
Attach files when sending emails
Embed images in HTML or CSS via data URI
Preserve raw bytes of cryptographic functions
Output binary data as XML or JSON in API responses
Save binary files to database when BLOB is unavailable
Hide secrets from prying eyes (really a very bad idea)
Command Line Tool (CLI)
Encode and Decode:
Base64 is not an encryption algorithm and in no case should it be used to “hash” passwords or “encrypt” sensitive data, because it is a reversible algorithm and the encoded data can be easily decoded. Base64 may only be used to encode raw result of a cryptographic function.
Roughly speaking, in terms of information security, Base64 is just a foreign language that some people do not understand. Nevertheless, even they can understand the meaning of the encoded message simply by using an online translator, which instantly returns the original message.
base64: invalid input
A likely reason for 76 being the default is that Base64 encoding was to provide a way to include binary files in e-mails and Usenet postings which was intended for humans using monitors with 80 characters width. Having a 76-character width as default made that usecase easier.
-w, --wrap=COLS will wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping.
For macOS, use
-b, --break to break encoded string into num character lines.
echo cloudolife.com | base64 -w 0