Rohit Nirmal Base64 is a data encoding scheme that represents binary data in an ASCII string format by translating it into a radix-64 representation.
Base64 encoding schemes are commonly used when there is a need to encode binary data that needs be stored and transferred over media that are designed to deal with textual data. This is to ensure that the data remains intact without modification during transport. Base64 is commonly used in a number of applications including email via MIME, and storing complex data in XML.
So, when we send a binary file e.g. a class file or a JPG image as e-mail attachment, the mail client converts the binary file into Base64 format and then it sends this Base64 data over.
Similarly if we want to send a binary file via XML data, we have to first convert it into Base64 format and this Base64 data is included in the XML file. The reason is that XML is only supposed to have ASCII characters.
The number of output bytes per input byte is approximately 4 / 3 (33% overhead) and converges to that value for a large number of bytes. More specifically, given an input of n bytes, the output will be 4 [n/3] bytes long, including padding characters.
Base64 is often used to embed binary data in an XML file, using a syntax similar to <data encoding="base64">------ </data>
Base64 is heavily used for PHP obfuscation.
In Unix, Base64 is used to store a password hash computed with crypt in the /etc/passwd
For further information, please search Google for 'Base64' or 'Base64 Encoding'.
A good discussion of the character set of Base64 alphabet and example of converting binary data into Base64 can be found here .
Another good discussion of Base64 and example of converting binary data into Base64 can be found here .