Base64 encoding and decoding schemes are commonly used to encode binary data. Normally this is required when textual data needs to be transferred over the network or similar media and make sure that data is transferred without any modification. Base64 is commonly used in a number of applications, including email via MIME, and storing complex data in XML. When base64 encoding is used in email encryption it is called Privacy enhanced Electronic mail (PEM).

One of the most common uses of Base 64 encoding on the web is to encode binary data that so it can be included in a data: URL. This allows content creators or web developers to embed images or files inline in documents. Base64 data is generally url-safe, and that’s why it can be used to encode data in Data URLs.

Base64 Encoding and decoding C Program

This is a very simple implementation of base64 encoding and decoding in C programming language. There are number of C libraries available for encoding and decoding as well i.e. libb64, OpenSSL Base64, Apple’s Implementations, arduino-base64 etc.

Output of the Base64 Encoding Program

The output of the above program is as below: