ハードディスクの暗号化

Compatible Nitrokeys

3A/C/Mini

Passkey

HSM 2

Pro 2

FIDO2

Storage 2

Start

U2F

active

inactive

active

active

inactive

active

active

inactive

VeraCrypt (旧TrueCrypt)

`VeraCrypt <https://www.veracrypt.fr/en/Home.html>`_は、Windows、macOS、GNU/Linuxに対応したフリーでオープンソースのディスク暗号化ソフトウェアです。TrueCryptの後継であるため推奨されていますが、以下の説明はTrueCryptにも当てはまります。

Follow these steps to use the program with Nitrokey Storage 2 or Nitrokey Pro 2:

  1. 最新リリースの`OpenSC <https://github.com/OpenSC/OpenSC/wiki>`_をインストールするか、`PKCS#11ライブラリ <http://smartcard-auth.de/download-en.html>`_をダウンロードします。

  2. Choose the library in VeraCrypt under Settings>Preferences>Security Token (location depends on system, e.g. /usr/lib/opensc).

  3. Tools>Keyfile Generatorで64バイトのキーファイルを生成します。

  4. Now you should be able to import the generated key file via Tools>Manage Security Token Keyfiles. You should choose the first Slot ([0] User PIN). The keyfile is then stored on the Nitrokey as Private Data Object 1 (PrivDO1).

  5. その後、オリジナルのキーファイルをあなたのコンピュータ上で安全に消去してください。

  6. VeraCryptをNitrokeyで使えるようになりました。コンテナを作成し、パスワードの代わりにデバイス上のキーファイルを選択します。

警告

セキュリティへの配慮

Please note that VeraCrypt doesn't make use of the full security which Nitrokey (and smart cards in general) offer. Instead it stores a keyfile on the Nitrokey which theoretically could be stolen by a compromised host, since the Private Data Object 1 is not protected by the Nitrokey's PIN.

LinuxにおけるLUKS/dm-cryptを用いたハードディスクの暗号化

LUKSディスク暗号化のセットアップについては、ガイドに従ってください:

Purism has created a simple script to add the Nitrokey/LibremKey as a way to unlock LUKS partitions (not tested by Nitrokey yet).

このプロジェクトは Nitrokey Pro や Password Safe (Nitrokey ではまだテストされていません)をベースにした Storage で LUKS の使用を容易にすることを目的としています。Gentoo での使用方法の説明は、`こちら <https://amedeos.github.io/gentoo/nitrokey/2019/01/21/gentoo-nitrokey-luks.html>`_にあります。

Arch Linux では、initramfs-scencrypt を参照してください。

GNU+LinuxでのEncFSによるストレージの暗号化

Tip

前提条件

`デバイスドライバーのインストール、デフォルトのPINの変更、GnuPG<https://www.nitrokey.com/start>`_での鍵の生成またはインポートが行われていることを確認してください。

EncFS is an easy to utlity for encrypted file systems and it is based on FUSE. You may follow these steps to use it with very long passwords and Nitrokey Pro 2.

初期化

  1. ランダムなデータを持つキーファイルを作成します。

    $ dd bs=64 count=1 if=/dev/urandom of=keyfile
    
  2. キーファイルを暗号化し、NitrokeyのUser-IDを使用してください。

    $ gpg --encrypt keyfile
    
  3. キーファイルを平文で削除します。

    $ rm keyfile # you may want to use 'wipe' or 'shred' to securely delete the keyfile
    
  4. マウントポイントの作成

    $ mkdir ~/.cryptdir ~/cryptdir
    
  5. 実際の暗号化フォルダの作成

    $ gpg -d keyfile.gpg | encfs -S ~/.cryptdir ~/cryptdir
    # There may appears an error message about missing permission of fusermount
    # This message can be ignored
    
  6. 新しいファイルシステムをアンマウントします。

    $ fusermount -u ~/cryptdir
    

使用方法

  1. 暗号化されたファイルシステムをマウントし、NitrokeyのPINを入力する。

    $ gpg -d keyfile.gpg | encfs -S ~/.cryptdir ~/cryptdir
    
  2. 使用後は、ファイルシステムをアンマウントしてください。

    $ fusermount -u ~/cryptdir
    

ECryptFSによるLinuxでのストレージ暗号化

`eCryptfs <https://www.ecryptfs.org/>`_は、Linux用のファイルベースの透過型暗号化ファイルシステムで、PKCS#11ドライバを介してNitrokeyと一緒に使用することができます。

`説明書 <http://tkxuyen.com/blog/?p=293>`_をご覧ください。

  1. 証明書と鍵をNitrokeyにインポートします。

    # Warning: This will delete existing keys on your Nitrokey!
    $ pkcs15-init --delete-objects privkey,pubkey --id 3 --store-private-key user@example.com.p12 --format pkcs12 --auth-id 3 --verify-pin
    
  2. ファイル ~/.ecryptfsrc.pkcs11 を作成します。

    $ editor ~/.ecryptfsrc.pkcs11
    
  3. この内容を入力してください。

    $ pkcs11-log-level=5 pkcs11-provider1,name=name,library=/usr/lib/opensc-pkcs11.so,cert-private=true
    $ openvpn --show-pkcs11-ids path to opensc-pkcs11 module
    Certificate
        DN: /description=Iv4IQpLO02Mnix9i/CN=user@example.com/emailAddress=user@example.com
        Serial: 066E04
        Serialized id: ZeitControl/PKCS\x2315\x20emulated/000500000c7f/OpenPGP\x20card\x20\x28User\x20PIN\x29/03
    
  4. シリアル化されたIDを後で使用するためにコピーします。

    $ ecryptfs-manager
    # This will show list option. Choose option "Add public key to keyring"
    # Choose pkcs11-helper
    # Enter the serialized ID of step 3 to PKCS#11 ID.
    

または、`ESOSI <http://sourceforge.net/projects/esosi/>`_を試すか、OpenSCとOpenVPNを使って以下の手順を実行してください。

ガイドのソース: https://www.nitrokey.com/documentation/applications#a:hard-disk-encryption