Base 64 encoding is a method used in email systems. The email systems that where developed back in the time of Arpanet, where designed to support only Letters (A-Z,a-z) , Numbers (0-9) and some limited puncutation marks. So inorder to transfer files which can contain more than characters and digits (for eg,a picture.jpg file), Base 64 Encoding is used.
Base 64 encoding, as the name suggests, has 64 different characters to represent all the 255 characters in the ASCII code. 64 different characters implies 6 bits as the word length. (no: of bits to represent a character)(2^6=64). So the encoding method is to group the binary data in groups of 6 bits.
Now the grouped 6 bits words are represented by letters, digits and punctuations. A table is defined to denote the mappings of the bit pattern to a corresponding character. Here is a sample of base64 encoding:
which stands for This is an example of base64 encoding.
You can find out more about this on google
Base64 encoding is used in more than email systems, it is used in URL encoding of binary data. Those using google mail will have seen a stream of letters on their address bar. This base64 encoding of data. Google cookie or in short Gookie also use Base64 encoding to store data. The SID is a base64 encoding.
Similarly Orkut cookie structure is as follows:
INF=0:SET=:LNG=1:CNT=91:RM=0:USR=[Base64 of your email]:
Have more information on this? Leave a comment...
PHP base64 functions are :
$ret = base64_encode($str);
$ret = base64_decode($str);