Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Base64
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Privacy-enhanced mail=== The first known standardized use of the encoding now called MIME Base64 was in the [[Privacy-enhanced Electronic Mail]] (PEM) protocol, proposed by {{IETF RFC|989}} in 1987. PEM defines a "printable encoding" scheme that uses Base64 encoding to transform an arbitrary sequence of [[octet (computing)|octets]] to a format that can be expressed in short lines of 6-bit characters, as required by transfer protocols such as [[SMTP]].<ref>{{cite IETF |title=Privacy Enhancement for Internet Electronic Mail |rfc=989 |date=February 1987 |publisher=[[Internet Engineering Task Force|IETF]] |access-date=March 18, 2010}}</ref> The current version of PEM (specified in {{IETF RFC|1421}}) uses a 64-character alphabet consisting of upper- and lower-case [[Roman letters]] (<code>A</code>β<code>Z</code>, <code>a</code>β<code>z</code>), the numerals (<code>0</code>β<code>9</code>), and the <code>+</code> and <code>/</code> symbols. The <code>=</code> symbol is also used as a padding suffix.<ref name="rfc 1421"/> The original specification, {{IETF RFC|989}}, additionally used the <code>*</code> symbol to delimit encoded but unencrypted data within the output stream. To convert data to PEM printable encoding, the first byte is placed in the [[most significant bit|most significant]] eight bits of a 24-bit [[data buffer|buffer]], the next in the middle eight, and the third in the [[least significant bit|least significant]] eight bits. If there are fewer than three bytes left to encode (or in total), the remaining buffer bits will be zero. The buffer is then used, six bits at a time, most significant first, as indices into the string: "<code>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/</code>", and the indicated character is output. The process is repeated on the remaining data until fewer than four octets remain. If three octets remain, they are processed normally. If fewer than three octets (24 bits) are remaining to encode, the input data is right-padded with zero bits to form an integral multiple of six bits. After encoding the non-padded data, if two octets of the 24-bit buffer are padded-zeros, two <code>=</code> characters are appended to the output; if one octet of the 24-bit buffer is filled with padded-zeros, one <code>=</code> character is appended. This signals the decoder that the zero bits added due to padding should be excluded from the reconstructed data. This also guarantees that the encoded output length is a multiple of 4 bytes. PEM requires that all encoded lines consist of exactly 64 printable characters, with the exception of the last line, which may contain fewer printable characters. Lines are delimited by whitespace characters according to local (platform-specific) conventions.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)