... | @@ -259,6 +259,9 @@ This guide assumes the following: |
... | @@ -259,6 +259,9 @@ This guide assumes the following: |
|
possibly overkill, a full discussion of those trade-offs would be
|
|
possibly overkill, a full discussion of those trade-offs would be
|
|
irrelevant here)
|
|
irrelevant here)
|
|
|
|
|
|
|
|
* the YubiKey has been obtained from trusted channels and verified
|
|
|
|
(see [Unpacking and authenticating a YubiKey](#unpacking-and-authenticating-a-yubikey)
|
|
|
|
|
|
### Install software and preparation
|
|
### Install software and preparation
|
|
|
|
|
|
You will need to install [GnuPG](https://gnupg.org/), its `scdaemon` component and a
|
|
You will need to install [GnuPG](https://gnupg.org/), its `scdaemon` component and a
|
... | @@ -276,62 +279,136 @@ Make sure the key is detected: |
... | @@ -276,62 +279,136 @@ Make sure the key is detected: |
|
|
|
|
|
ykman list
|
|
ykman list
|
|
|
|
|
|
This should show your key, for example this is with my old NEO:
|
|
This should show your key, for example this is with a recent YubiKey 5
|
|
|
|
NFC (USB-A):
|
|
|
|
|
|
$ ykman list
|
|
$ ykman list
|
|
YubiKey NEO (3.4.3) [OTP+FIDO+CCID]
|
|
YubiKey 5 NFC (5.4.3) [OTP+FIDO+CCID] Serial: [REDACTED]
|
|
$
|
|
$
|
|
|
|
|
|
Make sure the right things are enabled:
|
|
In the above, you can see the string `[OTP+FIDO+CCID]` which basically
|
|
|
|
tells you that you can use the token for "OTP" ([One-Time
|
|
|
|
Passwords](https://en.wikipedia.org/wiki/One-time_password) in general, but in this particular case it's actually
|
|
|
|
[TOTP](https://en.wikipedia.org/wiki/Time-based_one-time_password), AKA "Google Authenticator"), [FIDO2](https://en.wikipedia.org/wiki/FIDO_Alliance), and [CCID](https://en.wikipedia.org/wiki/CCID_(protocol)), the
|
|
|
|
"chip card interface device" protocol.
|
|
|
|
|
|
|
|
Those are all different "applications" shipped with the YubiKey that
|
|
|
|
can be enabled or disabled independently. OpenPGP operations rely on
|
|
|
|
the latter (CCID), so it needs to be listed in the above output.
|
|
|
|
|
|
|
|
If it isn't, use this to enable it (and, in this example, also FIDO2):
|
|
|
|
|
|
|
|
ykman config mode FIDO+CCID
|
|
|
|
|
|
|
|
You may want to disable NFC if you are not going to use it:
|
|
|
|
|
|
$ ykman info
|
|
ykman config nfc --disable-all
|
|
Device type: YubiKey NEO
|
|
|
|
Firmware version: 3.0.0
|
|
The end result should look something like this:
|
|
|
|
|
|
|
|
anarcat@angela:~$ ykman info
|
|
|
|
Device type: YubiKey 5 NFC
|
|
|
|
Serial number: [REDACTED]
|
|
|
|
Firmware version: 5.4.3
|
|
Form factor: Keychain (USB-A)
|
|
Form factor: Keychain (USB-A)
|
|
Enabled USB interfaces: OTP, FIDO, CCID
|
|
Enabled USB interfaces: FIDO, CCID
|
|
NFC transport is enabled.
|
|
NFC transport is enabled.
|
|
|
|
|
|
Applications USB NFC
|
|
Applications USB NFC
|
|
FIDO2 Not available Not available
|
|
FIDO2 Enabled Disabled
|
|
OTP Enabled Enabled
|
|
OTP Disabled Disabled
|
|
FIDO U2F Enabled Enabled
|
|
FIDO U2F Enabled Disabled
|
|
OATH Enabled Enabled
|
|
OATH Enabled Disabled
|
|
YubiHSM Auth Not available Not available
|
|
YubiHSM Auth Disabled Disabled
|
|
OpenPGP Enabled Enabled
|
|
OpenPGP Enabled Disabled
|
|
PIV Enabled Enabled
|
|
PIV Enabled Disabled
|
|
|
|
|
|
TODO: check with an actual YK5.
|
|
Note that "You must remove and re-insert your YubiKey for this change
|
|
|
|
to take effect", as indicated.
|
|
|
|
|
|
TODO: talk about applications, TL;DR:
|
|
Finally, you should really set a new PIN and admin PIN on the
|
|
|
|
key. This is easily done with GnuPG itself, first enter the magic
|
|
|
|
`card-edit` shell with:
|
|
|
|
|
|
ykman config mode FIDO+CCID
|
|
gpg --card-edit
|
|
|
|
|
|
TODO: check what those do from [Ultimate Yubikey Setup Guide with ed25519!][]
|
|
That will show you the following prompt:
|
|
|
|
|
|
ykman openpgp set-touch aut cached
|
|
gpg/card>
|
|
ykman openpgp set-touch sig on
|
|
|
|
ykman openpgp set-touch enc on
|
|
|
|
|
|
|
|
TODO: pin change
|
|
There you need to type the `admin` and `passwd` commands to change the
|
|
|
|
first PIN:
|
|
|
|
|
|
ykman
|
|
gpg/card> admin
|
|
|
|
Admin commands are allowed
|
|
|
|
|
|
TODO: wtf is a management key, see
|
|
gpg/card> passwd
|
|
https://developers.yubico.com/yubikey-piv-manager/PIN_and_Management_Key.html
|
|
gpg: OpenPGP card no. [REDACTED] detected
|
|
and
|
|
|
|
https://gist.github.com/xirkus/20552a9b026413cc84191131bbeeb48a#yubikeys-default-state-of-insecurity
|
|
|
|
|
|
|
|
TODO: wtf all PINs, see [drduh's guide](https://github.com/drduh/YubiKey-Guide#change-pin) which talks about [the
|
|
1 - change PIN
|
|
reset pin](https://forum.yubico.com/viewtopicd01c.html?p=9055#p9055)
|
|
2 - unblock PIN
|
|
|
|
3 - change Admin PIN
|
|
|
|
4 - set the Reset Code
|
|
|
|
Q - quit
|
|
|
|
|
|
TODO: consider YK KDF, see [drduh's guide](https://github.com/drduh/YubiKey-Guide#enable-kdf):
|
|
Your selection? 1
|
|
|
|
|
|
gpg --card-edit
|
|
This will prompt you for the current PIN. The factory default is
|
|
gpg/card> admin
|
|
`123456` (yes, just like the combination on someone's luggage).
|
|
gpg/card> kdf-setup
|
|
|
|
|
|
Also set the Admin PIN in that way:
|
|
|
|
|
|
|
|
gpg/card> passwd
|
|
|
|
gpg: OpenPGP card no. [REDACTED] detected
|
|
|
|
|
|
|
|
1 - change PIN
|
|
|
|
2 - unblock PIN
|
|
|
|
3 - change Admin PIN
|
|
|
|
4 - set the Reset Code
|
|
|
|
Q - quit
|
|
|
|
|
|
|
|
Your selection? 3
|
|
|
|
[... pinentry prompt ...]
|
|
|
|
PIN changed.
|
|
|
|
|
|
|
|
I typically set both to the same value since the basic PIN basically
|
|
|
|
allows any operation I'm worried about (short of changing the keys)
|
|
|
|
anyway. Furthermore, if they would be different, I would very likely
|
|
|
|
forget the admin PIN and wouldn't be able to reset the normal PIN
|
|
|
|
after too many failed attempts.
|
|
|
|
|
|
|
|
You may also want to enable the [KDF feature on newer
|
|
|
|
YubiKeys](https://developers.yubico.com/PGP/YubiKey_5.2.3_Enhancements_to_OpenPGP_3.4.html#_key_derived_format). This allows the YubiKey to store the PIN as a hashed
|
|
|
|
value instead of cleartext, and makes it harder to bruteforce as the
|
|
|
|
caller needs to run the KDF function. This was [implemented in
|
|
|
|
2017](https://dev.gnupg.org/T3152) and is not necessarily supported by all clients. It's also
|
|
|
|
irreversible, so beware. To turn it on, simply call `kdf-setup` on the
|
|
|
|
`gpg/card>` prompt.
|
|
|
|
|
|
|
|
#### Details about reset, admin, and PIN
|
|
|
|
|
|
|
|
The OpenPGP applet has three different PINs:
|
|
|
|
|
|
|
|
1. the normal PIN: used in normal operation, when you need to unlock
|
|
|
|
the card to do a cryptographic operation
|
|
|
|
|
|
|
|
2. the Admin PIN: used to unlock the card if the above "normal PIN"
|
|
|
|
gets input incorrectly too many times, or configure card
|
|
|
|
(e.g. add/remove keys, change name, etc)
|
|
|
|
|
|
|
|
3. the reset PIN: used to *only* unlock the card (e.g. like the Admin
|
|
|
|
PIN except it cannot do the other things)
|
|
|
|
|
|
|
|
By default, the reset PIN is not used in YubiKeys and, indeed, it
|
|
|
|
might not make sense for a single-user case. According to [this
|
|
|
|
comment](https://forum.yubico.com/viewtopicd01c.html?p=9055#p9055) it's designed for enterprise setups where administrators
|
|
|
|
configure keys for users and do not want to let them change their own
|
|
|
|
keys. See also [drduh's guide](https://github.com/drduh/YubiKey-Guide#change-pin) for a discussion on this.
|
|
|
|
|
|
### key generation
|
|
### key generation
|
|
|
|
|
|
|
|
TODO: move this to howto/openpgp.md?
|
|
|
|
|
|
Here we're generating a new OpenPGP key as we're transitioning from an
|
|
Here we're generating a new OpenPGP key as we're transitioning from an
|
|
old RSA4096 key. DO NOT follow those steps if you wish to keep your
|
|
old RSA4096 key. DO NOT follow those steps if you wish to keep your
|
|
old key, of course.
|
|
old key, of course.
|
... | @@ -344,24 +421,320 @@ TODO: talk about airgapped systems and tmpfs |
... | @@ -344,24 +421,320 @@ TODO: talk about airgapped systems and tmpfs |
|
|
|
|
|
TODO: talk about why not generating on the key
|
|
TODO: talk about why not generating on the key
|
|
|
|
|
|
GNUPGHOME=${XDG_RUNTIME_DIR:-/nonexistent}
|
|
Here we're going to generate an Elliptic Curve (ECC) key using the
|
|
gpg --full-gen-key # TODO: --expert?
|
|
[Curve25519](https://en.wikipedia.org/wiki/Curve25519). That curve has been supported by OpenSSH [since 2014
|
|
FINGERPRINT=0000000000000000000000000000000000000000
|
|
(6.5)](https://www.openssh.com/txt/release-6.5) and GnuPG [since 2021 (2.1)](https://gnupg.org/faq/whats-new-in-2.1.html) and is the de-facto standard
|
|
|
|
since the revelations surrounding possibly the [back-doored NIST
|
|
TODO: talk about expiration date
|
|
curves](https://en.wikipedia.org/wiki/Dual_EC_DRBG).
|
|
|
|
|
|
TODO: how to generate a SC, A E key and why (because 3 slots and screw S vs C)
|
|
TODO: debunk EC concerns in [this gist](https://gist.github.com/xirkus/20552a9b026413cc84191131bbeeb48a) as we're not ecdsa, we're
|
|
|
|
ed25519. make this a separate rant?
|
|
TODO: talk about ed25519, debunk EC concerns in [this gist](https://gist.github.com/xirkus/20552a9b026413cc84191131bbeeb48a) as
|
|
|
|
we're not ecdsa, we're ed25519
|
|
This unfortunately (still) requires `--expert` mode unfortunately.
|
|
|
|
|
|
TODO: lint key with `hokey lint`, from [drduh's guide](https://github.com/drduh/YubiKey-Guide#verify)
|
|
```
|
|
|
|
export GNUPGHOME=${XDG_RUNTIME_DIR:-/nonexistent}/.gnupg/
|
|
Sign the new key with old key:
|
|
anarcat@angela:~[SIGINT]$ gpg --full-gen-key --expert
|
|
|
|
gpg (GnuPG) 2.2.40; Copyright (C) 2022 g10 Code GmbH
|
|
|
|
This is free software: you are free to change and redistribute it.
|
|
|
|
There is NO WARRANTY, to the extent permitted by law.
|
|
|
|
|
|
|
|
Please select what kind of key you want:
|
|
|
|
(1) RSA and RSA (default)
|
|
|
|
(2) DSA and Elgamal
|
|
|
|
(3) DSA (sign only)
|
|
|
|
(4) RSA (sign only)
|
|
|
|
(7) DSA (set your own capabilities)
|
|
|
|
(8) RSA (set your own capabilities)
|
|
|
|
(9) ECC and ECC
|
|
|
|
(10) ECC (sign only)
|
|
|
|
(11) ECC (set your own capabilities)
|
|
|
|
(13) Existing key
|
|
|
|
(14) Existing key from card
|
|
|
|
Your selection? 11
|
|
|
|
|
|
|
|
Possible actions for a ECDSA/EdDSA key: Sign Certify Authenticate
|
|
|
|
Current allowed actions: Sign Certify
|
|
|
|
|
|
|
|
(S) Toggle the sign capability
|
|
|
|
(A) Toggle the authenticate capability
|
|
|
|
(Q) Finished
|
|
|
|
|
|
|
|
Your selection? q
|
|
|
|
Please select which elliptic curve you want:
|
|
|
|
(1) Curve 25519
|
|
|
|
(3) NIST P-256
|
|
|
|
(4) NIST P-384
|
|
|
|
(5) NIST P-521
|
|
|
|
(6) Brainpool P-256
|
|
|
|
(7) Brainpool P-384
|
|
|
|
(8) Brainpool P-512
|
|
|
|
(9) secp256k1
|
|
|
|
Your selection? 1
|
|
|
|
Please specify how long the key should be valid.
|
|
|
|
0 = key does not expire
|
|
|
|
<n> = key expires in n days
|
|
|
|
<n>w = key expires in n weeks
|
|
|
|
<n>m = key expires in n months
|
|
|
|
<n>y = key expires in n years
|
|
|
|
Key is valid for? (0) 1y
|
|
|
|
Key expires at mer 29 mai 2024 15:27:14 EDT
|
|
|
|
Is this correct? (y/N) y
|
|
|
|
|
|
|
|
GnuPG needs to construct a user ID to identify your key.
|
|
|
|
|
|
|
|
Real name: Antoine Beaupré
|
|
|
|
Email address: anarcat@anarc.at
|
|
|
|
Comment:
|
|
|
|
You are using the 'utf-8' character set.
|
|
|
|
You selected this USER-ID:
|
|
|
|
"Antoine Beaupré <anarcat@anarc.at>"
|
|
|
|
|
|
|
|
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
|
|
|
|
We need to generate a lot of random bytes. It is a good idea to perform
|
|
|
|
some other action (type on the keyboard, move the mouse, utilize the
|
|
|
|
disks) during the prime generation; this gives the random number
|
|
|
|
generator a better chance to gain enough entropy.
|
|
|
|
gpg: directory '/home/anarcat/.gnupg/openpgp-revocs.d' created
|
|
|
|
gpg: revocation certificate stored as '/home/anarcat/.gnupg/openpgp-revocs.d/D0D396D08E761095E2910413DDE8A0D1D4CFEE10.rev'
|
|
|
|
public and secret key created and signed.
|
|
|
|
|
|
|
|
pub ed25519/DDE8A0D1D4CFEE10 2023-05-30 [SC] [expires: 2024-05-29]
|
|
|
|
D0D396D08E761095E2910413DDE8A0D1D4CFEE10
|
|
|
|
uid Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
anarcat@angela:~$
|
|
|
|
```
|
|
|
|
|
|
|
|
Let's put this fingerprint aside, as we'll be using it over and over again:
|
|
|
|
|
|
|
|
FINGERPRINT=D0D396D08E761095E2910413DDE8A0D1D4CFEE10
|
|
|
|
|
|
|
|
Let's look at this key:
|
|
|
|
|
|
|
|
anarcat@angela:~$ gpg --edit-key $FINGERPRINT
|
|
|
|
gpg (GnuPG) 2.2.40; Copyright (C) 2022 g10 Code GmbH
|
|
|
|
This is free software: you are free to change and redistribute it.
|
|
|
|
There is NO WARRANTY, to the extent permitted by law.
|
|
|
|
|
|
|
|
Secret key is available.
|
|
|
|
|
|
|
|
gpg: checking the trustdb
|
|
|
|
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
|
|
|
|
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
|
|
|
|
gpg: next trustdb check due at 2024-05-29
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
trust: ultimate validity: ultimate
|
|
|
|
ssb cv25519/0E1C0B264FC7ADEA
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: E
|
|
|
|
[ultimate] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
gpg>
|
|
|
|
|
|
|
|
As we can see, this created two key pairs:
|
|
|
|
|
|
|
|
1. "primary key" which is a public/private key with the `S` (Signing)
|
|
|
|
and `C` (Certification) purposes. that key can be used to sign
|
|
|
|
messages, certify other keys, new identities, and subkeys
|
|
|
|
|
|
|
|
2. an `E` (encryption) "sub-key" pair which is used to encrypt and decrypt
|
|
|
|
messages
|
|
|
|
|
|
|
|
Note that the encryption key expires here, which is an annoying
|
|
|
|
feature. You can delete the key and recreate it this way:
|
|
|
|
|
|
|
|
```
|
|
|
|
anarcat@angela:~[SIGINT]$ gpg --expert --edit-key $FINGERPRINT
|
|
|
|
gpg (GnuPG) 2.2.40; Copyright (C) 2022 g10 Code GmbH
|
|
|
|
This is free software: you are free to change and redistribute it.
|
|
|
|
There is NO WARRANTY, to the extent permitted by law.
|
|
|
|
|
|
|
|
Secret key is available.
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
trust: ultimate validity: ultimate
|
|
|
|
ssb cv25519/0E1C0B264FC7ADEA
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: E
|
|
|
|
[ultimate] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
gpg> addkey
|
|
|
|
Please select what kind of key you want:
|
|
|
|
(3) DSA (sign only)
|
|
|
|
(4) RSA (sign only)
|
|
|
|
(5) Elgamal (encrypt only)
|
|
|
|
(6) RSA (encrypt only)
|
|
|
|
(7) DSA (set your own capabilities)
|
|
|
|
(8) RSA (set your own capabilities)
|
|
|
|
(10) ECC (sign only)
|
|
|
|
(11) ECC (set your own capabilities)
|
|
|
|
(12) ECC (encrypt only)
|
|
|
|
(13) Existing key
|
|
|
|
(14) Existing key from card
|
|
|
|
Your selection? 12
|
|
|
|
Please select which elliptic curve you want:
|
|
|
|
(1) Curve 25519
|
|
|
|
(3) NIST P-256
|
|
|
|
(4) NIST P-384
|
|
|
|
(5) NIST P-521
|
|
|
|
(6) Brainpool P-256
|
|
|
|
(7) Brainpool P-384
|
|
|
|
(8) Brainpool P-512
|
|
|
|
(9) secp256k1
|
|
|
|
Your selection? 1
|
|
|
|
Please specify how long the key should be valid.
|
|
|
|
0 = key does not expire
|
|
|
|
<n> = key expires in n days
|
|
|
|
<n>w = key expires in n weeks
|
|
|
|
<n>m = key expires in n months
|
|
|
|
<n>y = key expires in n years
|
|
|
|
Key is valid for? (0)
|
|
|
|
Key does not expire at all
|
|
|
|
Is this correct? (y/N) y
|
|
|
|
Really create? (y/N) y
|
|
|
|
We need to generate a lot of random bytes. It is a good idea to perform
|
|
|
|
some other action (type on the keyboard, move the mouse, utilize the
|
|
|
|
disks) during the prime generation; this gives the random number
|
|
|
|
generator a better chance to gain enough entropy.
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
trust: ultimate validity: ultimate
|
|
|
|
ssb cv25519/0E1C0B264FC7ADEA
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: E
|
|
|
|
ssb cv25519/9456BA69685EAFFB
|
|
|
|
created: 2023-05-30 expires: never usage: E
|
|
|
|
[ultimate] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
gpg> key 1
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
trust: ultimate validity: ultimate
|
|
|
|
ssb* cv25519/0E1C0B264FC7ADEA
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: E
|
|
|
|
ssb cv25519/9456BA69685EAFFB
|
|
|
|
created: 2023-05-30 expires: never usage: E
|
|
|
|
[ultimate] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
gpg> delkey
|
|
|
|
Do you really want to delete this key? (y/N) y
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
trust: ultimate validity: ultimate
|
|
|
|
ssb cv25519/9456BA69685EAFFB
|
|
|
|
created: 2023-05-30 expires: never usage: E
|
|
|
|
[ultimate] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
```
|
|
|
|
|
|
|
|
We'll also add a third key here, which is an `A` (Authentication) key,
|
|
|
|
which will be used for SSH authentication:
|
|
|
|
|
|
|
|
```
|
|
|
|
gpg> addkey
|
|
|
|
Please select what kind of key you want:
|
|
|
|
(3) DSA (sign only)
|
|
|
|
(4) RSA (sign only)
|
|
|
|
(5) Elgamal (encrypt only)
|
|
|
|
(6) RSA (encrypt only)
|
|
|
|
(7) DSA (set your own capabilities)
|
|
|
|
(8) RSA (set your own capabilities)
|
|
|
|
(10) ECC (sign only)
|
|
|
|
(11) ECC (set your own capabilities)
|
|
|
|
(12) ECC (encrypt only)
|
|
|
|
(13) Existing key
|
|
|
|
(14) Existing key from card
|
|
|
|
Your selection? 11
|
|
|
|
|
|
|
|
Possible actions for a ECDSA/EdDSA key: Sign Authenticate
|
|
|
|
Current allowed actions: Sign
|
|
|
|
|
|
|
|
(S) Toggle the sign capability
|
|
|
|
(A) Toggle the authenticate capability
|
|
|
|
(Q) Finished
|
|
|
|
|
|
|
|
Your selection? a
|
|
|
|
|
|
|
|
Possible actions for a ECDSA/EdDSA key: Sign Authenticate
|
|
|
|
Current allowed actions: Sign Authenticate
|
|
|
|
|
|
|
|
(S) Toggle the sign capability
|
|
|
|
(A) Toggle the authenticate capability
|
|
|
|
(Q) Finished
|
|
|
|
|
|
|
|
Your selection? s
|
|
|
|
|
|
|
|
Possible actions for a ECDSA/EdDSA key: Sign Authenticate
|
|
|
|
Current allowed actions: Authenticate
|
|
|
|
|
|
|
|
(S) Toggle the sign capability
|
|
|
|
(A) Toggle the authenticate capability
|
|
|
|
(Q) Finished
|
|
|
|
|
|
|
|
Your selection? q
|
|
|
|
Please select which elliptic curve you want:
|
|
|
|
(1) Curve 25519
|
|
|
|
(3) NIST P-256
|
|
|
|
(4) NIST P-384
|
|
|
|
(5) NIST P-521
|
|
|
|
(6) Brainpool P-256
|
|
|
|
(7) Brainpool P-384
|
|
|
|
(8) Brainpool P-512
|
|
|
|
(9) secp256k1
|
|
|
|
Your selection? 1
|
|
|
|
Please specify how long the key should be valid.
|
|
|
|
0 = key does not expire
|
|
|
|
<n> = key expires in n days
|
|
|
|
<n>w = key expires in n weeks
|
|
|
|
<n>m = key expires in n months
|
|
|
|
<n>y = key expires in n years
|
|
|
|
Key is valid for? (0)
|
|
|
|
Key does not expire at all
|
|
|
|
Is this correct? (y/N) y
|
|
|
|
Really create? (y/N) y
|
|
|
|
We need to generate a lot of random bytes. It is a good idea to perform
|
|
|
|
some other action (type on the keyboard, move the mouse, utilize the
|
|
|
|
disks) during the prime generation; this gives the random number
|
|
|
|
generator a better chance to gain enough entropy.
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
trust: ultimate validity: ultimate
|
|
|
|
ssb cv25519/9456BA69685EAFFB
|
|
|
|
created: 2023-05-30 expires: never usage: E
|
|
|
|
ssb ed25519/9FF21704D101630D
|
|
|
|
created: 2023-05-30 expires: never usage: A
|
|
|
|
[ultimate] (1)* Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
```
|
|
|
|
|
|
|
|
TODO: talk about expiration dates, see also [drduh's note #3 on this](https://github.com/drduh/YubiKey-Guide#notes)
|
|
|
|
|
|
|
|
TODO: talk about using a SC key and why
|
|
|
|
|
|
|
|
At this point, you should have a functional and valid set of OpenPGP
|
|
|
|
certificates! It's a good idea to check the key with with `hokey
|
|
|
|
lint`, from [hopenpgp-tools](https://salsa.debian.org/clint/hopenpgp-tools):
|
|
|
|
|
|
|
|
gpg --export $FINGERPRINT | hokey lint
|
|
|
|
|
|
|
|
Following the above guide, I ended up with a key that is all green
|
|
|
|
except for the authentication key having `False` in `embedded
|
|
|
|
cross-cert`. According to [drduh's guide](https://github.com/drduh/YubiKey-Guide#verify), that doesn't matter:
|
|
|
|
|
|
|
|
> hokey may warn (orange text) about cross certification for the
|
|
|
|
> authentication key. GPG's [Signing Subkey Cross-Certification](https://gnupg.org/faq/subkey-cross-certify.html)
|
|
|
|
> documentation has more detail on cross certification, and gpg v2.2.1
|
|
|
|
> notes "subkey does not sign and so does not need to be
|
|
|
|
> cross-certified".
|
|
|
|
|
|
|
|
When you are confident the new key can be put in use, sign the the new
|
|
|
|
key with old key:
|
|
|
|
|
|
gpg --default-key $OLDKEY --sign-key $FINGERPRINT
|
|
gpg --default-key $OLDKEY --sign-key $FINGERPRINT
|
|
|
|
|
|
Revoke the old key:
|
|
And revoke the old key:
|
|
|
|
|
|
gpg --generate-revocation $OLDKEY
|
|
gpg --generate-revocation $OLDKEY
|
|
|
|
|
... | @@ -371,13 +744,43 @@ procedure fails. |
... | @@ -371,13 +744,43 @@ procedure fails. |
|
TODO: Generate a revocation cert for the new key as well, talk about
|
|
TODO: Generate a revocation cert for the new key as well, talk about
|
|
printing and OCR?
|
|
printing and OCR?
|
|
|
|
|
|
TODO: move this entire section to howto/openpgp?
|
|
|
|
|
|
|
|
### export to backup
|
|
### export to backup
|
|
|
|
|
|
gpg --export-secret-keys $FINGERPRINT > secret.key
|
|
TODO: explain
|
|
gpg --export-secret-subkeys $FINGERPRINT > secret-subkeys.key
|
|
|
|
gpg --export $FINGERPRINT > public.key
|
|
Export the entire key bundle into a temporary in-memory directory, tar
|
|
|
|
all those files and self-encrypt:
|
|
|
|
|
|
|
|
BACKUP_DIR=/mnt/...
|
|
|
|
export TMP_BACKUP_DIR=${XDG_RUNTIME_DIR:-/nonexistent}/gnupg-backup/ &&
|
|
|
|
mkdir $TMP_BACKUP_DIR &&
|
|
|
|
(
|
|
|
|
umask 0077 &&
|
|
|
|
gpg --export-secret-keys $FINGERPRINT > $TMP_BACKUP_DIR/secret.key &&
|
|
|
|
gpg --export-secret-subkeys $FINGERPRINT > $TMP_BACKUP_DIR/secret-subkeys.key &&
|
|
|
|
gpg --export $FINGERPRINT > $TMP_BACKUP_DIR/public.key &&
|
|
|
|
tar -C ${XDG_RUNTIME_DIR:-/nonexistent} -c -f - gnupg-backup \
|
|
|
|
| gpg --encrypt --recipient $FINGERPRINT - \
|
|
|
|
> $BACKUP_DIR/gnupg-backup.tar.pgp &&
|
|
|
|
cp $BACKUP_DIR/public.key $BACKUP_DIR
|
|
|
|
)
|
|
|
|
|
|
|
|
Test decryption:
|
|
|
|
|
|
|
|
gpg --decrypt ${XDG_RUNTIME_DIR:-/nonexistent}/gnupg-backup.tar.pgp | file -
|
|
|
|
|
|
|
|
Where you store this backup (`$BACKUP_DIR` above) is up to you. I
|
|
|
|
store it in my password manager, which happens to be encrypted with
|
|
|
|
GnuPG itself, but that may vary. Some people might prefer a USB drive
|
|
|
|
hidden under their bed, but I tend to distrust inert storage since
|
|
|
|
it's known to lose data in the long term, especially when unused for a
|
|
|
|
long time.
|
|
|
|
|
|
|
|
Also note how we keep a plain-text copy of the public key. This is an
|
|
|
|
important precaution, especially if you're the paranoid type that
|
|
|
|
doesn't public their key anywhere. You *can* recover a working setup
|
|
|
|
from a backup YubiKey, but it's *much* harder if you don't have the
|
|
|
|
public key, so keep that around.
|
|
|
|
|
|
TODO: consider LUKS? or plain text? filesystem? exfat? SSSS? rejected
|
|
TODO: consider LUKS? or plain text? filesystem? exfat? SSSS? rejected
|
|
[drduh's LUKS approach](https://github.com/drduh/YubiKey-Guide#backup)
|
|
[drduh's LUKS approach](https://github.com/drduh/YubiKey-Guide#backup)
|
... | @@ -387,22 +790,201 @@ TODO: consider LUKS? or plain text? filesystem? exfat? SSSS? rejected |
... | @@ -387,22 +790,201 @@ TODO: consider LUKS? or plain text? filesystem? exfat? SSSS? rejected |
|
WARNING: this MOVES the key to the security card, make sure you have
|
|
WARNING: this MOVES the key to the security card, make sure you have
|
|
backups as explained above.
|
|
backups as explained above.
|
|
|
|
|
|
|
|
Now we're going to do the sensitive step of moving the secret keys
|
|
|
|
onto the YubiKey. First, edit the key:
|
|
|
|
|
|
gpg --edit-key $FINGERPRINT
|
|
gpg --edit-key $FINGERPRINT
|
|
|
|
|
|
then, for N in 1,2,3:
|
|
Then, to move the primary key, simply call:
|
|
|
|
|
|
|
|
keytocard
|
|
|
|
|
|
|
|
This will ask you where to store the key, select `(1) Signature key`.
|
|
|
|
|
|
|
|
Then move the two subkeys:
|
|
|
|
|
|
key $N
|
|
key 1
|
|
keytocard
|
|
keytocard
|
|
|
|
key 1
|
|
|
|
key 2
|
|
|
|
keytocard
|
|
|
|
|
|
|
|
The double `key 1` above is not an error: it deselects the first
|
|
|
|
subkey to only select the second subkey.
|
|
|
|
|
|
|
|
Here's an example run:
|
|
|
|
|
|
|
|
```
|
|
|
|
anarcat@angela:~$ gpg --edit-key $FINGERPRINT
|
|
|
|
gpg (GnuPG) 2.2.40; Copyright (C) 2022 g10 Code GmbH
|
|
|
|
This is free software: you are free to change and redistribute it.
|
|
|
|
There is NO WARRANTY, to the extent permitted by law.
|
|
|
|
|
|
|
|
Secret key is available.
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
trust: unknown validity: unknown
|
|
|
|
ssb cv25519/9456BA69685EAFFB
|
|
|
|
created: 2023-05-30 expires: never usage: E
|
|
|
|
ssb ed25519/9FF21704D101630D
|
|
|
|
created: 2023-05-30 expires: never usage: A
|
|
|
|
[ unknown] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
gpg> keytocard
|
|
|
|
Really move the primary key? (y/N) y
|
|
|
|
Please select where to store the key:
|
|
|
|
(1) Signature key
|
|
|
|
(3) Authentication key
|
|
|
|
Your selection? 1
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
trust: unknown validity: unknown
|
|
|
|
ssb cv25519/9456BA69685EAFFB
|
|
|
|
created: 2023-05-30 expires: never usage: E
|
|
|
|
ssb ed25519/9FF21704D101630D
|
|
|
|
created: 2023-05-30 expires: never usage: A
|
|
|
|
[ unknown] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
gpg> key 1
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
trust: unknown validity: unknown
|
|
|
|
ssb* cv25519/9456BA69685EAFFB
|
|
|
|
created: 2023-05-30 expires: never usage: E
|
|
|
|
ssb ed25519/9FF21704D101630D
|
|
|
|
created: 2023-05-30 expires: never usage: A
|
|
|
|
[ unknown] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
gpg> keytocard
|
|
|
|
Please select where to store the key:
|
|
|
|
(2) Encryption key
|
|
|
|
Your selection? 2
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
card-no: 0006 23116859
|
|
|
|
trust: unknown validity: unknown
|
|
|
|
ssb* cv25519/9456BA69685EAFFB
|
|
|
|
created: 2023-05-30 expires: never usage: E
|
|
|
|
ssb ed25519/9FF21704D101630D
|
|
|
|
created: 2023-05-30 expires: never usage: A
|
|
|
|
[ unknown] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
gpg> key 1
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
card-no: 0006 23116859
|
|
|
|
trust: unknown validity: unknown
|
|
|
|
ssb cv25519/9456BA69685EAFFB
|
|
|
|
created: 2023-05-30 expires: never usage: E
|
|
|
|
ssb ed25519/9FF21704D101630D
|
|
|
|
created: 2023-05-30 expires: never usage: A
|
|
|
|
[ unknown] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
gpg> key 2
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
card-no: 0006 23116859
|
|
|
|
trust: unknown validity: unknown
|
|
|
|
ssb cv25519/9456BA69685EAFFB
|
|
|
|
created: 2023-05-30 expires: never usage: E
|
|
|
|
ssb* ed25519/9FF21704D101630D
|
|
|
|
created: 2023-05-30 expires: never usage: A
|
|
|
|
[ unknown] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
gpg> keytocard
|
|
|
|
Please select where to store the key:
|
|
|
|
(3) Authentication key
|
|
|
|
Your selection? 3
|
|
|
|
|
|
|
|
sec ed25519/02293A6FA4E53473
|
|
|
|
created: 2023-05-30 expires: 2024-05-29 usage: SC
|
|
|
|
card-no: 0006 23116859
|
|
|
|
trust: unknown validity: unknown
|
|
|
|
ssb cv25519/9456BA69685EAFFB
|
|
|
|
created: 2023-05-30 expires: never usage: E
|
|
|
|
card-no: 0006 23116859
|
|
|
|
ssb* ed25519/9FF21704D101630D
|
|
|
|
created: 2023-05-30 expires: never usage: A
|
|
|
|
[ unknown] (1). Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
|
|
|
|
gpg> save
|
|
|
|
```
|
|
|
|
|
|
Then keys should *not* be present in the keyring:
|
|
Then keys should *not* be present in the keyring:
|
|
|
|
|
|
gpg --list-secret-keys
|
|
anarcat@angela:1000$ gpg --list-secret-keys
|
|
|
|
/run/user/1000/.gnupg/pubring.kbx
|
|
|
|
---------------------------------
|
|
|
|
sec> ed25519 2023-05-30 [SC] [expires: 2024-05-29]
|
|
|
|
BBB6CD4C98D74E1358A752A602293A6FA4E53473
|
|
|
|
Card serial no. = 0006 23638206
|
|
|
|
uid [ultimate] Antoine Beaupré <anarcat@anarc.at>
|
|
|
|
ssb> cv25519 2023-05-30 [E]
|
|
|
|
ssb> ed25519 2023-05-30 [A]
|
|
|
|
|
|
|
|
In the above, we can see the secret keys are not present because they
|
|
|
|
are marked `sec>` and `ssb>`, not `sec` and `ssb`.
|
|
|
|
|
|
|
|
### touch policy
|
|
|
|
|
|
|
|
This is optional.
|
|
|
|
|
|
`sec>`, not `sec`.
|
|
You may want to change the touch policy. This requires you to touch
|
|
|
|
the YubiKey to consent to cryptographic operation. I set the following
|
|
|
|
policy:
|
|
|
|
|
|
|
|
ykman openpgp keys set-touch sig on
|
|
|
|
ykman openpgp keys set-touch enc on
|
|
|
|
ykman openpgp keys set-touch aut cached
|
|
|
|
|
|
|
|
NOTE: the above didn't work before the OpenPGP keys were created, that
|
|
|
|
is normal.
|
|
|
|
|
|
|
|
That means:
|
|
|
|
|
|
|
|
1. touch is required to confirm signatures
|
|
|
|
2. touch is required to confirm decryption
|
|
|
|
3. touch is required to confirm authentication, but is cached 15
|
|
|
|
seconds
|
|
|
|
|
|
|
|
The latter merits some explanation. I operate a lot of servers, and
|
|
|
|
sometimes run batch commands on many of them at once. Tapping for
|
|
|
|
every one of those would lead to alert fatigue and be extremely
|
|
|
|
annoying. The 15 seconds delay is a good compromise.
|
|
|
|
|
|
|
|
You can see the current policies with `ykman openpgp info`, for
|
|
|
|
example:
|
|
|
|
|
|
|
|
$ ykman openpgp info
|
|
|
|
OpenPGP version: 3.4
|
|
|
|
Application version: 5.4.3
|
|
|
|
|
|
|
|
PIN tries remaining: 3
|
|
|
|
Reset code tries remaining: 0
|
|
|
|
Admin PIN tries remaining: 3
|
|
|
|
|
|
|
|
Touch policies
|
|
|
|
Signature key On
|
|
|
|
Encryption key On
|
|
|
|
Authentication key Cached
|
|
|
|
Attestation key Off
|
|
|
|
|
|
|
|
The default is to not require touch confirmations.
|
|
|
|
|
|
#### troubleshooting
|
|
#### troubleshooting
|
|
|
|
|
|
if this fails, check if GnuPG can see the card:
|
|
if this fails, check if GnuPG can see the card with:
|
|
|
|
|
|
|
|
gpg --card-status
|
|
|
|
|
|
|
|
You can also try this incantation, which should output the key's
|
|
|
|
firmware version:
|
|
|
|
|
|
gpg-connect-agent --hex "scd apdu 00 f1 00 00" /bye
|
|
gpg-connect-agent --hex "scd apdu 00 f1 00 00" /bye
|
|
|
|
|
... | @@ -420,13 +1002,75 @@ with a Yubikey 5 (TODO: confirm output): |
... | @@ -420,13 +1002,75 @@ with a Yubikey 5 (TODO: confirm output): |
|
D[0000] 05 01 00 90 00 .....
|
|
D[0000] 05 01 00 90 00 .....
|
|
OK
|
|
OK
|
|
|
|
|
|
Possible error:
|
|
A possible error is:
|
|
|
|
|
|
ERR 100663404 Card error <SCD>
|
|
ERR 100663404 Card error <SCD>
|
|
|
|
|
|
TODO: need `scdaemon`? see my own howto
|
|
That could be because of a permission error. Normally, `udev` rules
|
|
|
|
are in place to keep this from happening.
|
|
|
|
|
|
|
|
If everything goes south and you locked yourself out of your key, you
|
|
|
|
can completely wipe the OpenPGP applet with:
|
|
|
|
|
|
|
|
ykman openpgp reset
|
|
|
|
|
|
|
|
WARNING: that will WIPE all the keys on the device, make sure you have
|
|
|
|
a backup or that the keys are revoked!
|
|
|
|
|
|
|
|
### Making a second YubiKey copy
|
|
|
|
|
|
|
|
At this point, we have a backup of the keyring that is encrypted with
|
|
|
|
itself. We obviously can't recover this if we lose the YubiKey, so
|
|
|
|
let's exercise that disaster recovery by making a new key, completely
|
|
|
|
from the backups.
|
|
|
|
|
|
|
|
1. first, go through the [preparation](#preparation) steps above, namely setting
|
|
|
|
the CCID mode, disabling NFC, setting a PIN and so on
|
|
|
|
|
|
|
|
1. create a fresh new GnuPG home:
|
|
|
|
|
|
|
|
export GNUPGHOME=${XDG_RUNTIME_DIR:-/nonexistent}/.gnupg-restore
|
|
|
|
mkdir $GNUPGHOME
|
|
|
|
|
|
|
|
2. make sure you kill `gpg-agent` and related daemons, they can get
|
|
|
|
confused when multiple home directories are involved:
|
|
|
|
|
|
|
|
killall scdaemon gpg-agent
|
|
|
|
|
|
TODO: maybe just do `gpg --card-status` instead?
|
|
2. restore the public key:
|
|
|
|
|
|
|
|
gpg --import $BACKUP_DIR/public.key
|
|
|
|
|
|
|
|
3. confirm GnuPG can see the secret keys:
|
|
|
|
|
|
|
|
gpg --list-secret-keys
|
|
|
|
|
|
|
|
you should not see any `Card serial no.`, `sec>`, or `ssb>` in
|
|
|
|
there. If so, it might be because GnuPG got confused and still
|
|
|
|
thinks the old key is plugged in.
|
|
|
|
|
|
|
|
4. then, crucial step, restore the private key and subkeys:
|
|
|
|
|
|
|
|
gpg --decrypt $BACKUP_DIR/gnupg-backup.tar.pgp | tar -x -f - --to-stdout | gpg --import
|
|
|
|
|
|
|
|
5. then go through the `keytocard` process again, which is basically:
|
|
|
|
|
|
|
|
gpg --edit-key $FINGERPRINT
|
|
|
|
|
|
|
|
then:
|
|
|
|
|
|
|
|
keytocard
|
|
|
|
1
|
|
|
|
key 1
|
|
|
|
keytocard
|
|
|
|
key 2
|
|
|
|
key 1
|
|
|
|
keytocard
|
|
|
|
|
|
|
|
At this point the new key should be a good copy of the previous
|
|
|
|
YubiKey. If you are following this procedure because you have lost
|
|
|
|
your previous YubiKey, you should actually make *another* copy of the
|
|
|
|
YubiKey at this stage, to be able to recover when *this* key is lost.
|
|
|
|
|
|
### git
|
|
### git
|
|
|
|
|
... | @@ -472,13 +1116,9 @@ If not, make sure `SSH_AUTH_SOCK` is pointing at the GnuPG agent. |
... | @@ -472,13 +1116,9 @@ If not, make sure `SSH_AUTH_SOCK` is pointing at the GnuPG agent. |
|
TODO: recovery on new computer, basically import and trust, see
|
|
TODO: recovery on new computer, basically import and trust, see
|
|
[drduh's guide](https://github.com/drduh/YubiKey-Guide#using-keys)
|
|
[drduh's guide](https://github.com/drduh/YubiKey-Guide#using-keys)
|
|
|
|
|
|
TODO: recovery from backups (--import secrets in tmp keyring, keytocard)
|
|
TODO: see also [Recovering lost GPG public keys from your YubiKey – Nicholas
|
|
|
|
|
|
see also [Recovering lost GPG public keys from your YubiKey – Nicholas
|
|
|
|
Sherlock create](https://www.nicksherlock.com/2021/08/recovering-lost-gpg-public-keys-from-your-yubikey/) if even public key is missing.
|
|
Sherlock create](https://www.nicksherlock.com/2021/08/recovering-lost-gpg-public-keys-from-your-yubikey/) if even public key is missing.
|
|
|
|
|
|
TODO: `ykman openpgp reset`
|
|
|
|
|
|
|
|
TODO: https://github.com/drduh/YubiKey-Guide#troubleshooting
|
|
TODO: https://github.com/drduh/YubiKey-Guide#troubleshooting
|
|
|
|
|
|
### exporting SSH public key from GnuPG
|
|
### exporting SSH public key from GnuPG
|
... | @@ -491,6 +1131,10 @@ In older, you can also use: |
... | @@ -491,6 +1131,10 @@ In older, you can also use: |
|
|
|
|
|
ssh-add -L
|
|
ssh-add -L
|
|
|
|
|
|
|
|
### using the YubiKey on a new computer
|
|
|
|
|
|
|
|
TODO: using the YubiKey on a new computer
|
|
|
|
|
|
### Special considerations for storing encryption keys
|
|
### Special considerations for storing encryption keys
|
|
|
|
|
|
For *encryption* keys, however, special care need to be taken as the
|
|
For *encryption* keys, however, special care need to be taken as the
|
... | @@ -517,6 +1161,40 @@ If the `backup disk` did not exist, it would be impossible to recreate |
... | @@ -517,6 +1161,40 @@ If the `backup disk` did not exist, it would be impossible to recreate |
|
a new `main key` and, when the `backup key` is eventually lost or
|
|
a new `main key` and, when the `backup key` is eventually lost or
|
|
destroyed, the encrypted contents will not be readable anymore.
|
|
destroyed, the encrypted contents will not be readable anymore.
|
|
|
|
|
|
|
|
TODO: talk about nylon vs steel
|
|
|
|
|
|
|
|
### preliminary performance evaluation
|
|
|
|
|
|
|
|
Preparation:
|
|
|
|
|
|
|
|
```
|
|
|
|
dd if=/dev/zero count=1400 | gpg --encrypt --recipient 8DC901CE64146C048AD50FBB792152527B75921E > /tmp/test-rsa.pgp
|
|
|
|
dd if=/dev/zero count=1400 | gpg --encrypt --recipient BBB6CD4C98D74E1358A752A602293A6FA4E53473 > /tmp/test-ecc.pgp
|
|
|
|
```
|
|
|
|
|
|
|
|
RSA native (non-Yubikey) performance:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ time gpg --decrypt < /tmp/test-rsa.pgp
|
|
|
|
gpg: encrypted with 4096-bit RSA key, ID A51D5B109C5A5581, created 2009-05-29
|
|
|
|
"Antoine Beaupré <anarcat@orangeseeds.org>"
|
|
|
|
0.00user 0.00system 0:00.03elapsed 18%CPU (0avgtext+0avgdata 6516maxresident)k
|
|
|
|
0inputs+8outputs (0major+674minor)pagefaults 0swaps
|
|
|
|
```
|
|
|
|
|
|
|
|
ECC security key (YubiKey 5) performance:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ time gpg --decrypt < /tmp/test-ecc.pgp
|
|
|
|
gpg: encrypted with 255-bit ECDH key, ID 9456BA69685EAFFB, created 2023-05-30
|
|
|
|
"Antoine Beaupré <anarcat@torproject.org>"
|
|
|
|
0.00user 0.03system 0:00.12elapsed 30%CPU (0avgtext+0avgdata 7672maxresident)k
|
|
|
|
0inputs+8outputs (0major+1834minor)pagefaults 0swaps
|
|
|
|
```
|
|
|
|
|
|
|
|
That is, 120ms vs 30ms, the YubiKey is 4 times slower than the normal
|
|
|
|
configuration. An acceptable compromise, perhaps.
|
|
|
|
|
|
## FAQ
|
|
## FAQ
|
|
|
|
|
|
### I don't have usb-c in my laptop, would i need an adaptor then?
|
|
### I don't have usb-c in my laptop, would i need an adaptor then?
|
... | | ... | |