encoding
Click on the red underlined text to get to the source
...
Base encoding of data is used in many situations to store or transfer
data in environments that, perhaps for legacy reasons, are restricted
to only US-ASCII ...
... to only US-ASCII [9] data. Base encoding can also be used in new
applications that do not have legacy restrictions, simply because it
makes it possible to manipulate objects with text editors.
...
... In the past, different applications have had different requirements
and thus sometimes implemented base encodings in slightly different
ways. Today, protocol specifications sometimes use base encodings ...
... encodings in slightly different
ways. Today, protocol specifications sometimes use base encodings in
general, and "base64" in particular, without a precise description or
...
... considering the consequences for line-wrapping or non-alphabet
characters. The purpose of this specification is to establish common
alphabet and encoding considerations. This will hopefully reduce
ambiguity in other documents, leading to better interoperability.
...
...
Here we discuss the discrepancies between base encoding
implementations in the past, and where appropriate, mandate a
specific recommended behavior for the future.
...
... MIME [3] is often used as a reference for base 64 encoding. However,
MIME does not define "base 64" per se, but rather a "base 64
...
... MIME does not define "base 64" per se, but rather a "base 64
Content-Transfer-Encoding" for use within MIME. As such, MIME
...
... enforces a limit on line length of base 64 encoded data to 76
characters. MIME inherits the encoding from PEM [2] stating it is
...
...
Base encodings use a specific, reduced, alphabet to encode binary
data. Non alphabet characters could exist within base encoded data,
caused by data corruption or by design. Non alphabet characters may
...
... attacks.
Implementations MUST reject the encoding if it contains characters
outside the base alphabet when interpreting base encoded data, unless
the specification referring to this document explicitly states
...
... MIME does, instead state that
characters outside the base encoding alphabet should simply be
ignored when interpreting data ("be liberal in what you accept").
Note that this means that any CRLF ...
... Base 64 Encoding ...
... 5].
The Base 64 encoding is designed to represent arbitrary sequences of
octets in a form that requires case sensitivity but need not be
humanly readable.
...
... is used to signify a special processing function.)
The encoding process represents 24-bit groups of input bits ...
... Special processing is performed if fewer than 24 bits are available
at the end of the data being encoded. A full encoding quantum is
always completed at the end of a quantity. When fewer than 24 input
bits ...
... can arise:
(1) the final quantum of encoding input is an integral multiple of 24
bits; here, the final unit of encoded output will be an integral
multiple of 4 characters with no "=" padding,
...
... multiple of 4 characters with no "=" padding,
(2) the final quantum of encoding input is exactly 8 bits; here, the
final unit of encoded output will be two characters followed by two
...
... "=" padding characters, or
(3) the final quantum of encoding input is exactly 16 bits; here, the
final unit of encoded output will be three characters followed by one
...
... An alternative alphabet has been suggested that used "~" as the 63rd
character. Since the "~" character has special meaning in some file
system environments, the encoding described in this section is
recommended instead.
...
... recommended instead.
This encoding should not be regarded as the same as the "base64"
encoding ...
... encoding should not be regarded as the same as the "base64"
encoding, and should not be referred to as only "base64". Unless
made clear, "base64 ...
... base64" refer to the base 64 in the previous section.
This encoding is technically identical to the previous one, except
for the 62:nd and 63:rd alphabet character, as indicated in table 2.
...
... URL and Filename safe" Base 64 Alphabet
Value Encoding Value Encoding Value Encoding Value Encoding ...
... Base 32 Encoding ...
... corrections).
The Base 32 encoding is designed to represent arbitrary sequences of
octets in a form that needs to be case insensitive but need not be
humanly readable.
...
... is used to signify a special processing function.)
The encoding process represents 40-bit groups of input bits ...
... groups, each
of which is translated into a single digit in the base 32 alphabet.
When encoding a bit stream via the base 32 encoding, the bit stream ...
... When encoding a bit stream via the base 32 encoding, the bit stream
must be presumed to be ordered with the most-significant-bit ...
... Special processing is performed if fewer than 40 bits are available
at the end of the data being encoded. A full encoding quantum is
always completed at the end of a body. When fewer than 40 input bits
...
... arise:
(1) the final quantum of encoding input is an integral multiple of 40
bits; here, the final unit of encoded output will be an integral
...
... multiple of 8 characters with no "=" padding,
(2) the final quantum of encoding input is exactly 8 bits; here, the
final unit of encoded output will be two characters followed by six
...
... "=" padding characters,
(3) the final quantum of encoding input is exactly 16 bits; here, the
final unit of encoded output will be four characters followed by four
...
... "=" padding characters,
(4) the final quantum of encoding input is exactly 24 bits; here, the
final unit of encoded output will be five characters followed by
...
... three "=" padding characters, or
(5) the final quantum of encoding input is exactly 32 bits; here, the
final unit of encoded output will be seven characters followed by one
...
... Base 16 Encoding ...
...
The following description is original but analogous to previous
descriptions. Essentially, Base 16 encoding is the standard standard
case insensitive hex encoding, and may be referred to as "base16 ...
... descriptions. Essentially, Base 16 encoding is the standard standard
case insensitive hex encoding, and may be referred to as "base16" or
"hex".
...
... represented per printable character.
The encoding process represents 8-bit groups (octets) of input bits ...
...
To translate between binary and a base encoding, the input is stored
in a structure and the output is extracted. The case for base 64 is
displayed in the following figure, borrowed from [4 ...
...
When implementing Base encoding and decoding, care should be taken
not to introduce vulnerabilities to buffer ...
...
If non-alphabet characters are ignored, instead of causing rejection
of the entire encoding (as recommended), a covert channel that can be
used to "leak" information is made possible. The implications of
...
... used to leak information.
Base encoding visually hides otherwise easily recognized information,
such as passwords, but does not provide any computational
...
... (perhaps to illustrate some other problem) and accidentally reveals
the password because she is unaware that the base encoding does not
protect the password.
...
... Hansen, Gordon Mohr, John Myers, Chris Newman, and Andrew Sieber.
Text used in this document is based on earlier RFCs describing
specific uses of various base encodings. The author acknowledges the
RSA Laboratories for supporting the work that led to this document.
...
