Szyfrowanie dysków twardych

Compatible Nitrokeys

3A/C/Mini

Passkey

HSM 2

Pro 2

FIDO2

Storage 2

Start

U2F

active

inactive

active

active

inactive

active

active

inactive

VeraCrypt (dawniej TrueCrypt)

VeraCrypt to darmowy i Open Source program do szyfrowania dysków dla Windows, macOS i GNU+Linux. Jest następcą TrueCrypta i dlatego jest zalecany, choć poniższe instrukcje powinny dotyczyć także TrueCrypta.

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

  1. Zainstaluj najnowsze wydanie OpenSC, lub pobierz PKCS#11 library.

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

  3. Wygeneruj 64-bajtowy plik klucza poprzez Tools>Keyfile Generator.

  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. Po tym powinieneś bezpiecznie wymazać oryginalny plik kluczowy na swoim komputerze!

  6. Teraz możesz używać VeraCrypt z Nitrokey: Utwórz kontener, wybierz plik klucza na urządzeniu jako alternatywę dla hasła.

Ostrzeżenie

Kwestia bezpieczeństwa

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.

Szyfrowanie dysku twardego w systemie GNU+Linux za pomocą LUKS/dm-crypt

Aby skonfigurować LUKS Disk Encryption, postępuj zgodnie z naszym przewodnikiem:

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

Ten projekt ma na celu ułatwienie korzystania z LUKS z Nitrokey Pro lub Storage opartym na Password Safe (jeszcze nie przetestowanym przez Nitrokey). Opis jak go używać na Gentoo można znaleźć ` tutaj <https://amedeos.github.io/gentoo/nitrokey/2019/01/21/gentoo-nitrokey-luks.html>`__.

Dla Arch Linux, zobacz initramfs-scencrypt.

Szyfrowanie pamięci masowej w systemie GNU+Linux za pomocą EncFS

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.

Inicjalizacja

  1. Utwórz plik klucza z losowymi danymi:

    $ dd bs=64 count=1 if=/dev/urandom of=keyfile
    
  2. Zaszyfruj plik z kluczem i użyj User-ID Twojego Nitrokey.

    $ gpg --encrypt keyfile
    
  3. Usuń plik klucza w postaci czystego tekstu:

    $ rm keyfile # you may want to use 'wipe' or 'shred' to securely delete the keyfile
    
  4. Utwórz punkt montowania:

    $ mkdir ~/.cryptdir ~/cryptdir
    
  5. Tworzenie rzeczywistego folderu szyfrowania

    $ 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. Odmontować nowy system plików:

    $ fusermount -u ~/cryptdir
    

Zastosowanie

  1. Zamontuj zaszyfrowany system plików i wprowadź PIN Nitrokey:

    $ gpg -d keyfile.gpg | encfs -S ~/.cryptdir ~/cryptdir
    
  2. Po użyciu należy odmontować system plików:

    $ fusermount -u ~/cryptdir
    

Szyfrowanie pamięci masowej w systemie GNU+Linux za pomocą ECryptFS

eCryptfs jest opartym na plikach systemem plików do przezroczystego szyfrowania dla GNU+Linux, który może być używany z Nitrokey poprzez sterownik PKCS#11.

Zobacz ` te <http://tkxuyen.com/blog/?p=293>`__ instrukcje:

  1. Zaimportuj certyfikat i klucz do 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. Utwórz plik ~/.ecryptfsrc.pkcs11:

    $ editor ~/.ecryptfsrc.pkcs11
    
  3. Wprowadź tę treść:

    $ 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. Skopiuj serializowane id do późniejszego użycia:

    $ 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.
    

Alternatywnie, spróbuj ESOSI lub wykonaj te kroki używając OpenSC i OpenVPN.

Źródło przewodnika: https://www.nitrokey.com/documentation/applications#a:hard-disk-encryption