# NK3 - Veracrypt keyfile accessible WITHOUT PIN entry

**URL:** <https://support.nitrokey.com/t/nk3-veracrypt-keyfile-accessible-without-pin-entry/7479>\
**Category:** Nitrokeys\
**Created:** [February 5, 2026, 8:11pm UTC](https://support.nitrokey.com/t/nk3-veracrypt-keyfile-accessible-without-pin-entry/7479 "2026-02-05T20:11:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![czietz](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@czietz](https://support.nitrokey.com/u/czietz)\
**Post date:** [February 5, 2026, 8:11pm UTC](https://support.nitrokey.com/t/nk3-veracrypt-keyfile-accessible-without-pin-entry/7479/1 "2026-02-05T20:11:35Z")

</div>

I have my Nitrokey 3 setup as OpenPGP card. Among other things, I wanted to store an VeraCrypt keyfile as described here: [Hard Disk Encryption - Nitrokey Documentation](https://docs.nitrokey.com/nitrokeys/features/openpgp-card/hard-disk-encryption/#veracrypt-formerly-truecrypt)

I installed OpenSC and added it as PKCS#11 library to VeraCrypt. Importing the keyfile to VeraCrypt works as described, and I can see it as `PrivDO1` with the token _OpenPGP card (User PIN)_.

**HOWEVER, there is a massive security issue! The keyfile is not protected by the PIN that I set for the card. It can be read _without any authentication_** using e.g. `openpgp-tool` from OpenSC:

```auto
openpgp-tool.exe -d 1
Using reader with a card: Nitrokey CCID/ICCD Interface 0
69 D6 4D 55 6D BC 87 65 AF 26 55 99 31 39 A9 92 i.MUm..e.&U.19..
66 75 23 C1 CD 7E 60 15 42 4A 60 3A 22 9E 5A E1 fu#..~`.BJ`:".Z.
C0 EC 85 DF C3 EF A0 01 6B A9 46 F4 DC 96 63 9C ........k.F...c.
E7 31 44 B0 ED 2D 1D 87 D9 F9 11 5A 52 6B F8 6D .1D..-.....ZRk.m

```

… or `gpg --edit-card`:

```auto
gpg --edit-card

Reader ...........: Nitrokey CCID/ICCD Interface 0
Application ID ...: D276000124010304000FE16B14F70000
Application type .: OpenPGP
Version ..........: 3.4
Manufacturer .....: Nitrokey
Serial number ....: [redacted]
Name of cardholder: [redacted]
Language prefs ...: [nicht gesetzt]
Salutation .......:
URL of public key : [nicht gesetzt]
Login data .......: [nicht gesetzt]
Private DO 1 .....: i\xd6\x4dUm\xbc\x87e\xaf&U\x9919\xa9\x92fu#\xc1\xcd~`\x15BJ`:"\x9eZ\xe1\xc0\xec\x85\xdf\xc3\xef\xa0\x01k\xa9F\xf4\xdc\x96c\x9c\xe7\x31D\xb0\xed\x2d\x1d\x87\xd9\xf9\x11ZRk\xf8\x6d

```

This obviously defeats the purpose of putting the keyfile on the Nitrokey. Note that I unplugged the Nitrokey to clear any cached PINs.

Please advise how to secure the VeraCrypt keyfile on the Nitrokey with the PIN (or don’t advertise this feature in your documentation).

---

<div class="post-metadata">

**Author:** ![czietz](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@czietz](https://support.nitrokey.com/u/czietz)\
**Post date:** [February 6, 2026, 9:13am UTC](https://support.nitrokey.com/t/nk3-veracrypt-keyfile-accessible-without-pin-entry/7479/2 "2026-02-06T09:13:12Z")

</div>

After a bit of research: Private Data Object 01 is indeed supposed to be always readable, according to the OpenPGP card spec 3.4.

 ![Screenshot_20260206_100534_Drive](https://support.nitrokey.com/uploads/default/original/2X/6/6f426a1799e3f2049ff25a9ac1f6a3c9c83f6bbf.png)

So, how do I get VeraCrypt / the Nitrokey to use PrivDO3 instead?

**Imho, at the very least the documentation on the Nitrokey site should be removed or reworked,** since having a key file always accessible defeats the purpose of putting it on the NK3 in the first place.

---

<div class="post-metadata">

**Author:** ![alexandre](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alexandre](https://support.nitrokey.com/u/alexandre)\
**Post date:** [February 9, 2026, 11:57am UTC](https://support.nitrokey.com/t/nk3-veracrypt-keyfile-accessible-without-pin-entry/7479/3 "2026-02-09T11:57:52Z")

</div>

Hello, in the documentation it clearly state that this is not safe and [Aloaha Crypt](https://www.aloaha.com/aloaha-crypt-disk/) is recommended which do not have this problem.

---

<div class="post-metadata">

**Author:** ![czietz](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@czietz](https://support.nitrokey.com/u/czietz)\
**Post date:** [February 9, 2026, 4:03pm UTC](https://support.nitrokey.com/t/nk3-veracrypt-keyfile-accessible-without-pin-entry/7479/4 "2026-02-09T16:03:11Z")

</div>

I’m sorry, but the documentation does **not** state that the key files are completely unprotected. In fact it incorrectly states quite the opposite:

> Instead it stores a keyfile on the Nitrokey which theoretically could be stolen by a computer virus _after the user enters the PIN_.

There is no PIN input required!

---

<div class="post-metadata">

**Author:** ![alexandre](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alexandre](https://support.nitrokey.com/u/alexandre)\
**Post date:** [February 10, 2026, 10:41am UTC](https://support.nitrokey.com/t/nk3-veracrypt-keyfile-accessible-without-pin-entry/7479/5 "2026-02-10T10:41:41Z")

</div>

You are right sorry, the PR is on its way.

Concerning changing the slot there is a github issue open on Verascrypt repo here:

> <https://github.com/veracrypt/VeraCrypt/issues/689>
>
> As a user I would like to have an option to select the PDO slot on my OpenPGP sm…art card, while saving the keyfile. Instead of the PDO1 I would like to use PDO3 or PDO4, which require User/Admin PIN (respectively) for the read operation.
> Changing defaults to PDO3 (instead of PDO1) for OpenPGP smart card would also work.
> 
> Right now Veracrypt saves keyfiles on the OpenPGP smart card in PDO1, where it is available to read without providing the PIN.

---

<div class="post-metadata">

**Author:** ![czietz](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@czietz](https://support.nitrokey.com/u/czietz)\
**Post date:** [February 12, 2026, 9:16pm UTC](https://support.nitrokey.com/t/nk3-veracrypt-keyfile-accessible-without-pin-entry/7479/6 "2026-02-12T21:16:53Z")

</div>

I did some debugging by capturing OpenSC’s debug output, while storing a keyfile on the Nitrokey with VeraCrypt. The relevant snippet is:

```auto
P:24016; T:17652 2026-02-12 22:07:46.329 [opensc-pkcs11] pkcs15-lib.c:2261:sc_pkcs15init_store_data_object: called
P:24016; T:17652 2026-02-12 22:07:46.329 [opensc-pkcs11] pkcs15-lib.c:2416:sc_pkcs15init_store_data: called
P:24016; T:17652 2026-02-12 22:07:46.329 [opensc-pkcs11] pkcs15-openpgp.c:433:openpgp_store_data: called
P:24016; T:17652 2026-02-12 22:07:46.329 [opensc-pkcs11] ===== App label test.bin
P:24016; T:17652 2026-02-12 22:07:46.329 [opensc-pkcs11] About to write to DO 0101
P:24016; T:17652 2026-02-12 22:07:46.329 [opensc-pkcs11] called; type=2, path=0101
P:24016; T:17652 2026-02-12 22:07:46.329 [opensc-pkcs11] card-openpgp.c:1459:pgp_select_file: called
P:24016; T:17652 2026-02-12 22:07:46.329 [opensc-pkcs11] called, tag=0101

```

This points towards the `openpgp_store_data` function in OpenSC, which has the following comment: “Currently, we only support DO 0101.”

> <https://github.com/OpenSC/OpenSC/blob/043343d2df7b09d1938bc3dc313d86a96be457cc/src/pkcs15init/pkcs15-openpgp.c#L487>

This explains why the keyfile is always stored as Private Data Object `PrivDO1` by VeraCrypt, which – again – does defeat the purpose of putting the keyfile on the Nitrokey in the first place.

Thank you for starting the PR regarding the documentation.

---

<div class="post-metadata">

**Author:** ![czietz](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@czietz](https://support.nitrokey.com/u/czietz)\
**Post date:** [February 14, 2026, 7:41pm UTC](https://support.nitrokey.com/t/nk3-veracrypt-keyfile-accessible-without-pin-entry/7479/7 "2026-02-14T19:41:27Z")

</div>

So, I’ve been writing my own PKCS#11 library from scratch that exposes the PIN-protected PrivDO3 to VeraCrypt to use as key file. It’s working now:

 ![grafik](https://support.nitrokey.com/uploads/default/original/2X/1/18257061d6c76b8597df42c961d9cba74b40c092.png)

… though perhaps lacking some error handling and documentation. Depending on my spare time and public interest, I might polish it for future release.

---

<div class="post-metadata">

**Author:** ![czietz](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@czietz](https://support.nitrokey.com/u/czietz)\
**Post date:** [February 21, 2026, 9:53am UTC](https://support.nitrokey.com/t/nk3-veracrypt-keyfile-accessible-without-pin-entry/7479/8 "2026-02-21T09:53:52Z")

</div>

Here is my PKCS11 library that allows VeraCrypt to use the PIN-protected PrivDO3 on the Nitrokey:

> **[GitHub - czietz/openpgp-privdo3-pkcs11: PKCS#11 library exposing Private Data Object 3 on...](https://github.com/czietz/openpgp-privdo3-pkcs11)**
>
> PKCS#11 library exposing Private Data Object 3 on OpenPGP cards

I’ve been using it daily for about a week, without encountering issues. But please note that it is provided “as is”, according to its license terms.
