「オープン認証イニシアチブ」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(序文を飜訳)
(→‎Standards: 飜訳)
23行目: 23行目:
 
* {{Pkg|qrencode}} - QR コードをエンコードします。
 
* {{Pkg|qrencode}} - QR コードをエンコードします。
   
== Standards ==
+
== 標準 ==
   
  +
OATH は、Arch ユーザーにとって重要な 2 つの標準を作成しました。どちらも任意の長さの Base32 エンコードされた共有シークレットに基づいています。
OATH has created two standards of significance to an Arch user, both based on a Base32-encoded shared secret of arbitrary length:
 
   
  +
; HOTP: HMAC(ハッシュベースのメッセージ認証コード)ワンタイムパスワード([[Wikipedia
; HOTP: HMAC (Hash-based message authentication code) One-time Password ([[Wikipedia:HMAC-based_One-time_Password_algorithm|HOTP]]). Every time a password is generated, a counter is incremented. This value is concatenated with a secret key, and then hashed to generate a 6-10 digit code. The authenticating party does the same, except it increments a counter when a code is successfully authenticated. To handle desynchronization of the counter, the authenticating party can also check several (30-100) additional values beyond its current counter state.
 
  +
|HOTP]])。パスワードが生成されるたびにカウンターが増加します。この値はシークレットキーと連結され、6~10 桁のコードを生成するためにハッシュされます。認証側も同様に処理しますが、コードが正常に認証されるとカウンターを増加させます。カウンターの非同期化を処理するために、認証側は現在のカウンター状態を超えて、さらに複数(30~100)の値をチェックすることができます。
; TOTP: Time-based one-time-password ([[Wikipedia:Time-based_One-time_Password_algorithm|TOTP]]), which works much like HOTP except it uses the current time instead of a counter. This solves the desynchronization problem, and eliminates the possibility of an adversary recording OTPs for use later.
 
  +
; TOTP: 時間ベースのワンタイムパスワード([[Wikipedia
  +
|TOTP]])。HOTP と非常によく似ていますが、カウンターの代わりに現在の時間を使用します。これにより、非同期化の問題が解決され、攻撃者が OTP を記録して後で使用する可能性が排除されます。
   
 
== URI credential format ==
 
== URI credential format ==

2024年8月16日 (金) 18:59時点における版

関連記事

オープン認証イニシアチブ (OATH)は、強力な認証の採用を促進するために、オープンスタンダードを使用したオープンなリファレンスアーキテクチャを開発するための業界全体の協力体制です。Google Authenticator やその他の一般的な2要素認証アプリケーションが使用する標準を公開しています。

インストール

以下のパッケージは、OATH 資格情報の生成、転送、および検証に使用できます。

  • oath-toolkit - 資格情報を受け取り、コードを生成します。ユーザー認証用の PAM モジュールが含まれています。詳細は pam_oath を参照してください。
  • libpam-google-authenticator - 新しい資格情報を生成するクライアントプログラム google-authenticator と、ユーザー認証用の PAM モジュールを提供します。詳細は Google Authenticator を参照してください。
  • pass-otp - pass に OATH サポートを追加します。
  • zbar - QR コードをデコードします。
  • qrencode - QR コードをエンコードします。

標準

OATH は、Arch ユーザーにとって重要な 2 つの標準を作成しました。どちらも任意の長さの Base32 エンコードされた共有シークレットに基づいています。

HOTP
HMAC(ハッシュベースのメッセージ認証コード)ワンタイムパスワード([[Wikipedia

|HOTP]])。パスワードが生成されるたびにカウンターが増加します。この値はシークレットキーと連結され、6~10 桁のコードを生成するためにハッシュされます。認証側も同様に処理しますが、コードが正常に認証されるとカウンターを増加させます。カウンターの非同期化を処理するために、認証側は現在のカウンター状態を超えて、さらに複数(30~100)の値をチェックすることができます。

TOTP
時間ベースのワンタイムパスワード([[Wikipedia

|TOTP]])。HOTP と非常によく似ていますが、カウンターの代わりに現在の時間を使用します。これにより、非同期化の問題が解決され、攻撃者が OTP を記録して後で使用する可能性が排除されます。

URI credential format

Credentials are usually shared in a QR-encoded URI format. All fields must be URI-encoded strings:

otpauth://TYPE/LABEL?PARAMETERS
警告: A URI formatted credential, and any QR code generated from it, contains all information required to generate valid one-time passwords. Protect it as you would any other password.
TYPE
totp or hotp
LABEL
Identifies which account a key is associated with, optionally prefixed with an issuer string. Example: Arch%20Wiki:alice@archlinux.org
PARAMETERS
Take the standard URI parameter format - ?name=value&name=value...
  • secret - required; this is the Base32 shared secret.
  • issuer - Indicates the provider or service the account is associated with. If this is absent, the issuer prefix of the label will be used. If both are present, they should be equal.
  • algorithm - SHA1 by default. Can also be SHA256 or SHA512.
  • digits - How long passcodes should be. Default is 6, can be 8.
  • counter - Required if using HOTP. Initial counter value.
  • period - Optional if using TOTP. Sets how long a code is valid, 30 seconds by default.

Here is an example:

otpauth://totp/Example%20Company:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example%20Company
         |type|  issuer prefix   |    account     |         secret        |     issuer            |
              |               label              |                  parameters                   |

Tips and tricks

Decode QR codes

This can be accomplished with tools from zbar. Decode a PNG file:

$ zbarimg my_qr_code.png --quiet --raw

Decode images from a camera:

$ zbarcam /dev/video0

Create QR codes

The qrencode package is useful here.

Encode a URI, save it as a PNG:

$ qrencode -o my_code.png 'MY_URI'

Encode a URI, print a QR code to the terminal:

$ qrencode -t ansiutf8 'MY_URI'

Generate keys

To generate your own key in the proper format, you can use something like the following:

$ head -c 16 /dev/urandom | base32 --wrap 0

Generate OTPs from the command line

Use oathtool(1) from oath-toolkit:

$ oathtool --base32 --totp KEY

Many password managers, including pass and KeePass also offer support for generating these codes.

Linux User authentication with PAM

See either pam_oath or Google Authenticator.

See also