この文書はRFC3548の日本語訳(和訳)です。 この文書の翻訳内容の正確さは保障できないため、 正確な知識や情報を求める方は原文を参照してください。 翻訳者はこの文書によって読者が被り得る如何なる損害の責任をも負いません。 この翻訳内容に誤りがある場合、訂正版の公開や、 誤りの指摘は適切です。 この文書の配布は元のRFC同様に無制限です。


Network Working Group                                  S. Josefsson, Ed.
Request for Comments: 3548                                     July 2003
Category: Informational


             The Base16, Base32, and Base64 Data Encodings
               ベース64とベース32とベース16コード化


Status of this Memo
この文書の状態



   This memo provides information for the Internet community.  It does
   not specify an Internet standard of any kind.  Distribution of this
   memo is unlimited.
   このメモはインターネット共同体のための情報を供給します。これはインター
   ネット標準を指定しません。このメモの配布は無制限です。

Copyright Notice
著作権表示


   Copyright (C) The Internet Society (2003).  All Rights Reserved.

Abstract
概要

   This document describes the commonly used base 64, base 32, and base
   16 encoding schemes.  It also discusses the use of line-feeds in
   encoded data, use of padding in encoded data, use of non-alphabet
   characters in encoded data, and use of different encoding alphabets.
   この文書は共通に使用するベース64とベース32とベース16コード化を
   記述します。またコード化されたデータでの改行の使用と、コード化された
   データでのパディングの使用と、コード化されたデータでの非アルファベッ
   トの文字の使用と、異なったコーディングアルファベットの使用を論じます。


Table of Contents
目次


   1.  Introduction
   1.  はじめに
   2.  Implementation discrepancies
   2.  実装の相違
       2.1.  Line feeds in encoded data
       2.1.  コード化データ内の改行
       2.2.  Padding of encoded data
       2.2.  コード化されたデータのパディング
       2.3.  Interpretation of non-alphabet characters in encoded data
       2.3.  コード化されたデータでの非アルファベットの文字の解釈
       2.4.  Choosing the alphabet
       2.4.  アルファベットの選択
   3.  Base 64 Encoding
   3.  ベース64コーディング
   4.  Base 64 Encoding with URL and Filename Safe Alphabet
   4.  URLとファイル名で安全なアルファベットのベース64コーディング
   5.  Base 32 Encoding
   5.  ベース32コーディング
   6.  Base 16 Encoding
   6.  ベース16コーディング
   7.  Illustrations and examples
   7.  イラストと例
   8.  Security Considerations
   8.  セキュリティの考察
   9.  References
   9.  参考文献
       9.1.  Normative References
       9.1.  参照する参考文献

       9.2.  Informative References
       9.2.  有益な参考文献
   10.  Acknowledgements
   10.  謝辞
   11.  Editor's Address
   11.  著者のアドレス
   12.  Full Copyright Statement
   12.  著作権表示全文


1.  Introduction
1.  はじめに

   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 [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.
   データのベースコーディングが、多分旧式であるため、US−ASCII[9]
   だけに制限されている環境での保存やデータ転送の多くの状況で使われます。
   ベースコーディングが旧式な制限を持っていない新しいアプリケーションで、
   テキストエディタでオブジェクトを編集できるという理由で、使うことがで
   きます。

   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 in
   general, and "base64" in particular, without a precise description or
   reference.  MIME [3] is often used as a reference for base64 without
   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.
   過去に、異なったアプリケーションが異なった必要条件のため、それでわず
   かに異なった方法でベースコーディングを実装しました。今日、プロトコル
   仕様書がしばしば一般的にベースコーディングを、特に、正確な記述や参考
   文献なしで「base64」を使います。MIME[3]は行のラッピングや非
   アルファベットの文字に関する結果を考えなずに、しばしばbase64の
   参考文献として使われます。この仕様書の目的は共通のアルファベットとコー
   ディングの考えを確立することです。これが、他の文書のあいまい性を減ら
   し、良い互換性を導く事を希望します。

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in RFC 2119 [1].
   この文書のキーワード"MUST"と"MUST NOT"と"REQUIRED"と"SHALL"と"SHALL
   NOT"と"SHOULD"と"SHOULD NOT"と"RECOMMENDED"と"MAY"と"OPTIONAL"はRF
   C2119[1]で記述されるように解釈されます。


2.  Implementation discrepancies
2.  実装の相違

   Here we discuss the discrepancies between base encoding
   implementations in the past, and where appropriate, mandate a
   specific recommended behavior for the future.
   ここで我々は過去におけるベースコーディング実装の間の矛盾を論じ、そし
   て適切な場合は、将来のために特定の推薦された行動を義務化します。

2.1.  Line feeds in encoded data
2.1.  コード化データ内の改行

   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
   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
   "virtually identical", however PEM uses a line length of 64
   characters.  The MIME and PEM limits are both due to limits within
   SMTP.
   MIME[3]はしばしばベース64コーディングの参考文献として使われます。
   しかしながら、MIMEは本質的に「ベース64」を定義せず、どちらかと
   言うとMIME内で使用するための「ベース64コンテンツ転送コーディン
   グ」を定義します。そして、MIMEはベース64でコードされたデータの
   行の長さを76文字に制限します。PEMが64文字の行長を使うが、MI
   MEは「事実上同一」でPEM[2]のコーディングを継承します。

   Implementations MUST NOT not add line feeds to base encoded data
   unless the specification referring to this document explicitly
   directs base encoders to add line feeds after a specific number of
   characters.
   MIMEとPEMの制限はSMTPの制限のためです。この文書を参照して
   いる仕様書が明示的に特定の文字数の後に改行を加えるようにベースエンコー
   ダに指示しないなら、実装がベースコード化されたデータに改行を加えては
   なりません(MUST NOT)。


2.2.  Padding of encoded data
2.2.  コード化されたデータのパディング

   In some circumstances, the use of padding ("=") in base encoded data
   is not required nor used.  In the general case, when assumptions on
   size of transported data cannot be made, padding is required to yield
   correct decoded data.
   ある状況で、ベースコードでのパディング(「=」)の使用が必要ないか使わ
   れません。一般的な場合で、送られたデータの大きさの仮定ができない時、
   パディングが正しい解読されたデータをもたらすために要求されます。

   Implementations MUST include appropriate pad characters at the end of
   encoded data unless the specification referring to this document
   explicitly states otherwise.
   この文書を参照する仕様書が明示的に他のことを言う場合を除き、実装が
   コード化されたデータの終わりに適切なパッド文字を含まなくてはなりま
   せん(MUST)。

2.3.  Interpretation of non-alphabet characters in encoded data
2.3.  コード化されたデータでの非アルファベットの文字の解釈

   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
   be exploited as a "covert channel", where non-protocol data can be
   sent for nefarious purposes.  Non alphabet characters might also be
   sent in order to exploit implementation errors leading to, e.g.,
   buffer overflow 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
   otherwise.  Such specifications may, as 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 constitute "non alphabet
   characters" and are ignored.  Furthermore, such specifications may
   consider the pad character, "=", as not part of the base alphabet
   until the end of the string.  If more than the allowed number of pad
   characters are found at the end of the string, e.g., a base 64 string
   terminated with "===", the excess pad characters could be ignored.
   この文書を参照する仕様書が明示的に他のことを述べない限り、実装はベー
   スコード化データを翻訳する時に、ベースアルファベット以外の文字を含ん
   でいるデータの、解読を拒絶してなければなりません(MUST)。このような指
   定は、MIMEの様に、ベースコーディングアルファベット以外の文字はデー
   タを翻訳する時に無視されるべきと述べるかもしれません(「受信に関して
   寛容」)。これはCRLFが「非アルファベット文字」を形成することを意
   味し、無視されることを指摘します。さらに、このような指定は文字列の終
   わ以外のパディング文字「=」をベースアルファベットの一部ではないと考え
   るかもしれません。もしパッド文字に許された数より多くのパッド文字が文
   字列の終わりにあるとき、例えばベース64文字列が「===」で終わるなら、
   余分のパッド文字が無視されます。

2.4.  Choosing the alphabet
2.4.  アルファベットの選択

   Different applications have different requirements on the characters
   in the alphabet.  Here are a few requirements that determine which
   alphabet should be used:
   異なったアプリケーションがアルファベット文字に異なった必要条件を持っ
   ています。ここにどのアルファベットが使われるべきであるかを決定する少
   数の条件があります:

   o   Handled by humans.  Characters "0", "O" are easily interchanged,
       as well "1", "l" and "I".  In the base32 alphabet below, where 0
       (zero) and 1 (one) is not present, a decoder may interpret 0 as
       O, and 1 as I or L depending on case.  (However, by default it
       should not, see previous section.)
       人による処理。文字「0」と「O」がすぐ読み間違えされ、「1」と
       「l」と「I」も同様です。下記のベース32アルファベットで、0
       (ゼロ)と1(壱)が存在ぜず、デコーダが0をOに、1を場合によって
       IかLと解釈するかもしれません。(しかしながら、デフォルトでそう
       するべきではありません、前の章を見てください。)

   o   Encoded into structures that place other requirements.  For base
       16 and base 32, this determines the use of upper- or lowercase
       alphabets.  For base 64, the non-alphanumeric characters (in
       particular "/") may be problematic in file names and URLs.
       他の必要条件がある構造の中にコード化する。ベース16とベース32
       で、これは大文字かあるいは小文字のアルファベットの使用を決定しま
       す。ベース64で、英数字でない文字(特に「/」)はファイル名とUR
       Lで問題が多いかもしれません。

   o   Used as identifiers.  Certain characters, notably "+" and "/" in
       the base 64 alphabet, are treated as word-breaks by legacy text
       search/index tools.
       識別子として用いる。ある特定の文字、特にベース64のアルファベッ
       トで「+」と「/」が、旧式なテキスト捜索/インデックスツールで単語
       の区切りとして扱われます。

   There is no universally accepted alphabet that fulfills all the
   requirements.  In this document, we document and name some currently
   used alphabets.
   すべての必要条件を満たす広く一般に受け入れられたアルファベットがあり
   ません。この文書で、我々はある現在使われたアルファベットを文書化し、
   命名します。

3.  Base 64 Encoding
3.  ベース64コーディング

   The following description of base 64 is due to [2], [3], [4] and [5].
   次のベース64の記述は[2]と[3]と[4]と[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.
   ベース64コーディングは大文字小文字の区別を必要とするが、人間の力で
   読みやすい必要がない形式で、任意のオクテット列を表すよう意図されます。

   A 65-character subset of US-ASCII is used, enabling 6 bits to be
   represented per printable character.  (The extra 65th character, "=",
   is used to signify a special processing function.)
   US−ASCIIのの内の65文字が、6ビットを印刷可能な文字に表現す
   るようにするために使われます。(余分の第65番目の文字「=」は特別な
   処理機能を意味するために使われます。)

   The encoding process represents 24-bit groups of input bits as output
   strings of 4 encoded characters.  Proceeding from left to right, a
   24-bit input group is formed by concatenating 3 8-bit input groups.
   These 24 bits are then treated as 4 concatenated 6-bit groups, each
   of which is translated into a single digit in the base 64 alphabet.
   コーディング処理は入力ビットの24ビットのグループを、4つのコード化
   文字の出力文字列とします。左から右へ処理し、3つの8ビットの入力グルー
   プを連結することによって、24ビットの入力グループが形成されます。こ
   れらの24ビットは4つの連結された6ビットのグループとして扱われ、そ
   してそれぞれはベース64のアルファベットのひとつの桁に翻訳されます。

   Each 6-bit group is used as an index into an array of 64 printable
   characters.  The character referenced by the index is placed in the
   output string.
   それぞれの6ビットのグループが64の印刷可能文字の配列のインデックス
   として用いられます。インデックスで参照された文字は出力文字列に置かれ
   ます。

                   Table 1: The Base 64 Alphabet
                   表1:ベース64アルファベット

      Value Encoding  Value Encoding  Value Encoding  Value Encoding
          0 A            17 R            34 i            51 z
          1 B            18 S            35 j            52 0
          2 C            19 T            36 k            53 1
          3 D            20 U            37 l            54 2
          4 E            21 V            38 m            55 3
          5 F            22 W            39 n            56 4
          6 G            23 X            40 o            57 5
          7 H            24 Y            41 p            58 6
          8 I            25 Z            42 q            59 7
          9 J            26 a            43 r            60 8
         10 K            27 b            44 s            61 9
         11 L            28 c            45 t            62 +
         12 M            29 d            46 u            63 /
         13 N            30 e            47 v
         14 O            31 f            48 w         (pad) =
         15 P            32 g            49 x
         16 Q            33 h            50 y

   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 are available in an input group, zero bits are added (on the
   right) to form an integral number of 6-bit groups.  Padding at the
   end of the data is performed using the '=' character.  Since all base
   64 input is an integral number of octets, only the following cases
   can arise:
   もしコード化するデータの終わりに24ビット未満しかデータがないときに
   特別な処理が行われます。完全なコーディングは常に一定量の終わりで完了
   します。入力グループで24インプットビット未満しか利用可能でない時、
   ゼロのビットが6の整数倍のビットグループを形成するために(右手に)足
   されます。データの終わりの穴埋めは「=」を使って行われます。すべての
   ベース64の入力が整数個のオクテットなので、次の場合だけが生じます:

   (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,
   (1) コーディング入力の最終部分は24ビットの倍数です;ここで、コード
   化された出力の終わりは、「=」なしの4の倍数個の文字であるでしょう。

   (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
   (2) コーディング入力の最終部分は正確に8ビットです;ここで、コード化
   された出力の終わりは、2文字とそれに続く2つの「=」文字であるでしょう。

   (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
   "=" padding character.
   (3) コーディング入力の最終部分は正確に16ビットです;ここで、コード
   化された出力の終わりは、3文字とは続1つの「=」文字であるでしょう。


4.  Base 64 Encoding with URL and Filename Safe Alphabet
4.  URLとファイル名で安全なアルファベットのベース64コーディング

   The Base 64 encoding with an URL and filename safe alphabet has been
   used in [8].
   URLとファイル名で安全なアルファベットのベース64コーディングは[8]
   で使われました。

   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.
   63番目のアルファベットの代わりの文字として「~」を使うのを示唆しまし
   た。「~」文字があるファイルシステム環境で特別な意味を持つので、この章
   で記述されたコーディングはその代わりとして勧められます。

   This 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" refer to the base 64 in the previous section.
   このコーディングは「ベース64」コーディングと同じと見なされるべきで
   はなくて、単純に「ベース64」と述べるべきではありません。明示しない
   限り、「ベース64」が前章のベース64を意味します。

   This encoding is technically identical to the previous one, except
   for the 62:nd and 63:rd alphabet character, as indicated in table 2.
   このコーディングは、62番目と63番目のアルファベット文字が表2で示
   されたものである以外は、技術的に前のものとまったく同じです。

         Table 2: The "URL and Filename safe" Base 64 Alphabet
         表2:「URL」とファイル名で安全なベース64アルファベット

    Value Encoding  Value Encoding  Value Encoding  Value Encoding
       0 A            17 R            34 i            51 z
       1 B            18 S            35 j            52 0
       2 C            19 T            36 k            53 1
       3 D            20 U            37 l            54 2
       4 E            21 V            38 m            55 3
       5 F            22 W            39 n            56 4
       6 G            23 X            40 o            57 5
       7 H            24 Y            41 p            58 6
       8 I            25 Z            42 q            59 7
       9 J            26 a            43 r            60 8
      10 K            27 b            44 s            61 9
      11 L            28 c            45 t            62 - (minus)
      12 M            29 d            46 u            63 _ (understrike)
      13 N            30 e            47 v
      14 O            31 f            48 w         (pad) =
      15 P            32 g            49 x
      16 Q            33 h            50 y

5.  Base 32 Encoding
5.  ベース32コーディング

   The following description of base 32 is due to [7] (with
   corrections).
   次のベース32の記述は[7]によります(訂正あり)。

   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.
   ベース32のコーディングは大文字小文字の違いを無視する必要がある形式
   で任意のオクテット列を表すよう意図されます、しかし人間の力で読み取り
   可能である必要がありません。

   A 33-character subset of US-ASCII is used, enabling 5 bits to be
   represented per printable character.  (The extra 33rd character, "=",
   is used to signify a special processing function.)
   US−ASCIIの33文字が、5ビットを印刷可能な文字で表すために使
   われます。(余分の第33番目の文字、「=」、は特別な処理機能を意味する
   ために使われます。)

   The encoding process represents 40-bit groups of input bits as output
   strings of 8 encoded characters.  Proceeding from left to right, a
   40-bit input group is formed by concatenating 5 8bit input groups.
   These 40 bits are then treated as 8 concatenated 5-bit 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
   must be presumed to be ordered with the most-significant-bit first.
   That is, the first bit in the stream will be the high-order bit in
   the first 8bit byte, and the eighth bit will be the low-order bit in
   the first 8bit byte, and so on.
   コーディング処理は入力ビットの40ビットのグループを8つのコード化さ
   れた出力文字列として描きます。左から右に処理して、5つの8ビット入力
   を連結することによって40ビットの入力グループが形成されます。これら
   の40ビットはそれから8つの5ビットのグループの連結として扱われ、そ
   してそれぞれはベース32のアルファベットを使ってひとつの桁として翻訳
   されます。ベース32のコーディングによってビット列をコード化する時、
   ビット列は最初に上位桁ビットがある順序と推測されなくてはなりません。
   すなわち、列の最初のビットは最初の8ビットバイトの最上位桁であるでしょ
   う、そして8番目のビットは最初の8ビットバイトの最下位ビットであるで
   しょう。

   Each 5-bit group is used as an index into an array of 32 printable
   characters.  The character referenced by the index is placed in the
   output string.  These characters, identified in Table 2, below, are
   selected from US-ASCII digits and uppercase letters.
   それぞれの5ビットのグループが32の印刷可能文字の配列のインデックス
   として用いられます。インデックスによって参照された文字は出力文字列に
   置かれます。これらの文字は、下記の表2で指定され、US−ASCIIの
   数字と大文字から選ばれます。

                   Table 3: The Base 32 Alphabet
                   表3:ベース32アルファベット

        Value Encoding  Value Encoding  Value Encoding  Value Encoding
            0 A             9 J            18 S            27 3
            1 B            10 K            19 T            28 4
            2 C            11 L            20 U            29 5
            3 D            12 M            21 V            30 6
            4 E            13 N            22 W            31 7
            5 F            14 O            23 X
            6 G            15 P            24 Y         (pad) =
            7 H            16 Q            25 Z
            8 I            17 R            26 2


   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
   are available in an input group, zero bits are added (on the right)
   to form an integral number of 5-bit groups.  Padding at the end of
   the data is performed using the "=" character.  Since all base 32
   input is an integral number of octets, only the following cases can
   arise:
   もし40ビット以下がコード化されるデータの終わりにで40ビット未満だ
   けが利用可能であるなら、特別な処理が行われます。完全なコーディングが
   常に本体の終わりで完了します。40ビット未満だけが入力グループで利用
   可能である時、ゼロのビットが5ビットのグループを形成するために(右手
   に)足されます。データの終わりの穴埋めは「=」文字を使って行われます。
   すべてのベース32の入力が整数個のオクテットで、ただ次の場合だけが生
   じます:

   (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,
   (1) コーディング入力の最終部分は40ビットの倍数です;ここで、コード
   化された出力の終わりは、「=」なしの8の倍数個の文字であるでしょう。

   (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,
   (2) コーディング入力の最終部分は正確に8ビットです;ここで、コード化
   された出力の終わりは、2文字とそれに続く6つの「=」文字であるでしょう。

   (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,
   (3) コーディング入力の最終部分は正確に16ビットです;ここで、コード
   化された出力の終わりは、4文字とそれに続く4つの「=」文字であるで
   しょう。

   (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
   (4) コーディング入力の最終部分は正確に24ビットです;ここで、コード
   化された出力の終わりは、5文字とそれに続く3つの「=」文字であるで
   しょう。

   (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
   "=" padding character.
   (5) コーディング入力の最終部分は正確に32ビットです;ここで、コード
   化された出力の終わりは、7文字とそれに続く1つの「=」文字であるで
   しょう。

6.  Base 16 Encoding
6.  ベース16コーディング

   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" or
   "hex".
   次の記述はオリジナルですが、前の記述に類似しています。本質的に、ベー
   ス16のコーディングが標準的な大文字小文字の違いを無視する16進法の
   コーディングであり、そして「ベース16」あるいは「16進法」であると
   述べられるかもしれません。

   A 16-character subset of US-ASCII is used, enabling 4 bits to be
   represented per printable character.
   US−ASCIIの16文字が、4ビットを印刷可能文字に表すために使わ
   れます。

   The encoding process represents 8-bit groups (octets) of input bits
   as output strings of 2 encoded characters.  Proceeding from left to
   right, a 8-bit input is taken from the input data.  These 8 bits are
   then treated as 2 concatenated 4-bit groups, each of which is
   translated into a single digit in the base 16 alphabet.
   コーディング処理は入力ビットの8ビットのグループを2つのコード化され
   た出力文字列として描きます。左から右に処理して、8ビットの入力が入力
   データからとられます。これらの8ビットは2つの連結された4ビットのグ
   ループとして扱われ、そしてそれぞれはベース16のアルファベットでひと
   つの桁に翻訳されます。

   Each 4-bit group is used as an index into an array of 16 printable
   characters.  The character referenced by the index is placed in the
   output string.
   それぞれの4ビットのグループが16の印刷可能文字の配列のインデックス
   として用いられます。インデックスによって参照された文字は出力文字列に
   置かれます。

                   Table 5: The Base 16 Alphabet
                   表5:ベース16アルファベット

      Value Encoding  Value Encoding  Value Encoding  Value Encoding
          0 0             4 4             8 8            12 C
          1 1             5 5             9 9            13 D
          2 2             6 6            10 A            14 E
          3 3             7 7            11 B            15 F

   Unlike base 32 and base 64, no special padding is necessary since a
   full code word is always available.
   ベース32とベース64と異なり、全てのコードが常に利用可能なので、特
   別な詰め物が必要ありません。


7.  Illustrations and examples
7.  イラストと例

   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].
   バイナリとベースコーディングの間で翻訳するために、入力は構造体に保存
   され、出力はは引き抜かれます。ベース64の場合は[4]から借用した下図で
   示されます。

         +--first octet--+-second octet--+--third octet--+
         |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|
         +-----------+---+-------+-------+---+-----------+
         |5 4 3 2 1 0|5 4 3 2 1 0|5 4 3 2 1 0|5 4 3 2 1 0|
         +--1.index--+--2.index--+--3.index--+--4.index--+

   The case for base 32 is shown in the following figure, borrowed from
   [6].  Each successive character in a base-32 value represents 5
   successive bits of the underlying octet sequence.  Thus, each group
   of 8 characters represents a sequence of 5 octets (40 bits).
   ベース32の場合は[6]から借用された次の図で示されます。それぞれのベー
   ス32値の連続した文字が、オクテット列の連続した5ビットを表します。
   それで、それぞれの8つの文字のグループが5つのオクテット列(40ビッ
   ト)を表します。

                        1          2          3
          01234567 89012345 67890123 45678901 23456789
         +--------+--------+--------+--------+--------+
         |< 1 >< 2| >< 3 ><|.4 >< 5.|>< 6 ><.|7 >< 8 >|
         +--------+--------+--------+--------+--------+
                                                 <===> 8th character
                                           <====> 7th character
                                      <===> 6th character
                                <====> 5th character
                          <====> 4th character
                     <===> 3rd character
               <====> 2nd character
          <===> 1st character


   The following example of Base64 data is from [4].
   次は[4]からのベース64データの例です。

       Input data:  0x14fb9c03d97e
       Hex:     1   4    f   b    9   c     | 0   3    d   9    7   e
       8-bit:   00010100 11111011 10011100  | 00000011 11011001
       11111110
       6-bit:   000101 001111 101110 011100 | 000000 111101 100111
       111110
       Decimal: 5      15     46     28       0      61     37     62
       Output:  F      P      u      c        A      9      l      +

       Input data:  0x14fb9c03d9
       Hex:     1   4    f   b    9   c     | 0   3    d   9
       8-bit:   00010100 11111011 10011100  | 00000011 11011001
                                                       pad with 00
       6-bit:   000101 001111 101110 011100 | 000000 111101 100100
       Decimal: 5      15     46     28       0      61     36
                                                          pad with =
       Output:  F      P      u      c        A      9      k      =

       Input data:  0x14fb9c03
       Hex:     1   4    f   b    9   c     | 0   3
       8-bit:   00010100 11111011 10011100  | 00000011
                                              pad with 0000
       6-bit:   000101 001111 101110 011100 | 000000 110000
       Decimal: 5      15     46     28       0      48
                                                   pad with =      =
       Output:  F      P      u      c        A      w      =      =

8.  Security Considerations
8.  セキュリティの考察

   When implementing Base encoding and decoding, care should be taken
   not to introduce vulnerabilities to buffer overflow attacks, or other
   attacks on the implementation.  A decoder should not break on invalid
   input including, e.g., embedded NUL characters (ASCII 0).
   ベースコード化と解読を実装する際に、実装でバッファオーバーフロー攻撃
   や他の攻撃に脆弱性を発生しないように注意すべきです。解読器が、例えば、
   埋め込みのNUL文字(ASCIIの0)を含む無効な入力で壊れるべきではあ
   りません。

   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
   this should be understood in applications that do not follow the
   recommended practice.  Similarly, when the base 16 and base 32
   alphabets are handled case insensitively, alteration of case can be
   used to leak information.
   全部のコーディングの拒否(推薦された動作)の代わりにもし非アルファベッ
   トの文字を無視するなら、情報を「漏らす」ための秘密のチャネルを作れる
   ようになります。これの意味は推薦された実行に従わないアプリケーション
   で理解されるべきです。同様に、ベース16とベース32のアルファベット
   が大文字小文字を区別する場合、大文字と小文字の変更を情報を漏らすため
   に使うことができます。

   Base encoding visually hides otherwise easily recognized information,
   such as passwords, but does not provide any computational
   confidentiality.  This has been known to cause security incidents
   when, e.g., a user reports details of a network protocol exchange
   (perhaps to illustrate some other problem) and accidentally reveals
   the password because she is unaware that the base encoding does not
   protect the password.
   ベースコーディングが、パスワードのような情報を、視覚的に容易に認識さ
   れないように隠しますが、計算的な機密性を供給しません。これは、例えば、
   ユーザが(多分何か他の問題を示すために)ネットワークプロトコル交換の
   細部を報告し、彼女がベースコーディングがパスワードを保護しないことに
   気付かない事で、偶然にパスワードを明らかにする時に、セキュリティ問題
   を起こすと知られています。

9.  References
9.  参考文献

9.1.  Normative References
9.1.  参照する参考文献


   [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement
       Levels", BCP 14, RFC 2119, March 1997.

9.2.  Informative References
9.2.  有益な参考文献

   [2] Linn, J., "Privacy Enhancement for Internet Electronic Mail:
       Part I: Message Encryption and Authentication Procedures", RFC
       1421, February 1993.

   [3] Freed, N. and N. Borenstein, "Multipurpose Internet Mail


       Extensions (MIME) Part One: Format of Internet Message Bodies",
       RFC 2045, November 1996.

   [4] Callas, J., Donnerhacke, L., Finney, H. and R. Thayer, "OpenPGP
       Message Format", RFC 2440, November 1998.

   [5] Eastlake, D., "Domain Name System Security Extensions", RFC 2535,
       March 1999.

   [6] Klyne, G. and L. Masinter, "Identifying Composite Media
       Features", RFC 2938, September 2000.

   [7] Myers, J., "SASL GSSAPI mechanisms", Work in Progress.

   [8] Wilcox-O'Hearn, B., "Post to P2P-hackers mailing list", World
       Wide Web http://zgp.org/pipermail/p2p-hackers/2001-
       September/000315.html, September 2001.

   [9] Cerf, V., "ASCII format for Network Interchange", RFC 20, October
       1969.

10.  Acknowledgements
10.  謝辞

   Several people offered comments and suggestions, including Tony
   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.
   Tony HansenとGordon MohrとJohn MyersとChris NewmanとAndrew Sieberを
   含む、数人の人々がコメントと示唆をくれました。この文書で使われたテキ
   ストが様々なベースコードの特定の使用を記述する以前のRFCに基づいて
   います。著者はRSA研究所がこの文書を導く仕事をサポートしたことに感
   謝します。



11.  Editor's Address
11.  著者のアドレス

   Simon Josefsson
   EMail: simon@josefsson.org



12.  Full Copyright Statement
12.  著作権表示全文

   Copyright (C) The Internet Society (2003).  All Rights Reserved.
   著作権(C)インターネット学会(2003)。すべての権利は保留される。

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works.  However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.
   上記著作権表示とこの段落が全ての複写や派生的な仕事につけられていれば、
   この文書と翻訳は複写や他者への提供ができ、そしてコメントや説明や実装
   を支援する派生的な仕事のためにこの文書の全部か一部を制約なく複写や出
   版や配布できます。しかし、この文書自身は、英語以外の言葉への翻訳やイ
   ンターネット標準を開発する目的で必要な場合以外は、インターネット学会
   や他のインターネット組織は著作権表示や参照を削除されるような変更がで
   きません、インターネット標準を開発する場合はインターネット標準化プロ
   セスで定義された著作権の手順に従われます。

   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assignees.
   上に与えられた限定された許可は永久で、インターネット学会やその後継者
   や譲渡者によって無効にされません。

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
   この文書とここに含む情報は無保証で供給され、そしてインターネット学会
   とインターネット技術標準化タスクフォースは、特別にも暗黙にも、この情
   報の利用が権利を侵害しないことや商業利用や特別の目的への利用に適当で
   ある事の保障を含め、すべての保証を拒否します。

Acknowledgement
謝辞

   Funding for the RFC Editor function is currently provided by the
   Internet Society.
   RFCエディタ機能のための資金供給が現在インターネット学会によって
   供給されます。

Japanese translation by Ishida So