age and post-quantum cryptography
age’s job is to keep your files confidential for a long time in the future. Due to recent updates to quantum cryptanalysis timelines, we don’t believe age’s original X25519-based keys are up to that job anymore, and you need to take action.
Your files encrypted with legacy keys could become retroactively decryptable in the future, sooner than most of us anticipated. You need to generate new post-quantum keys, and you need to re-encrypt files that were encrypted with legacy non-PQ keys.
If a file encrypted with legacy non-PQ keys is public or anyway recorded by an attacker, you should assume its contents could become compromised in the future regardless of whether it is re-encrypted now.
age v1.3.0 and rage 0.13.0 introduce support for new post-quantum key types. The
age v1.4.0 and rage 0.13.0 commands warn about any use of legacy non-PQ keys,
and change the age-keygen and rage-keygen default to post-quantum keys.
Future versions of age and rage will block encrypting with legacy non-PQ keys.
$ age --version
v1.4.0
$ age-keygen -o pq.txt
Public key: age1pq18e[... 1950 more characters ...]
$ age -d -i old.txt file.age | age -e -i pq.txt -o new.age
age: warning: the encrypted file could be decrypted by a future quantum computer, see https://age-encryption.org/pq-warning
You can opt-in to the block by setting AGE_PQC_REQUIRED to
ALLOW_ONLY_DECRYPT (the future default) or YES (which will also block
decryption). You will be able to opt-out from the block by setting it to
ALLOW_INSECURE (the current default).
You can separately opt-out of the warnings by setting AGE_PQC_WARNINGS to
SILENCE_I_KNOW_ITS_NOT_SAFE. You can also set it to VERBOSE to get more
details about which keys are not post-quantum and need replacing.
What about password encryption?
Password-encrypted files (age -p) are already post-quantum and require no
action. (Concerns about symmetric key sizes and quantum computers are
misguided.)
How can I tell if a key is secure?
The following prefixes indicate a secure, post-quantum key:
age1pq1…AGE-SECRET-KEY-PQ-1…age1tagpq1…
You can usually tell if a public key is post-quantum because it is very long. (Private keys are the same length as legacy non-PQ keys.)
Most other keys are not post-quantum, including:
age1…with no second 1AGE-SECRET-KEY-1…ssh-ed25519 AAAA…ssh-rsa AAAA…age1tag1…age1yubikey1…age1se1…age1tpm1…
You can test a key by using it with age v1.4.0 or rage 0.13.0 and
AGE_PQC_REQUIRED=YES.
How can I tell if a file is secure?
Use age-inspect with age v1.4.0.
$ age-inspect secrets.age
secrets.age is an age file, version "age-encryption.org/v1".
This file is encrypted to the following recipient types:
- "mlkem768x25519"
This file uses post-quantum encryption.
[...]
$ age-inspect legacy.age
legacy.age is an age file, version "age-encryption.org/v1".
This file is encrypted to the following recipient types:
- "X25519"
This file does NOT use post-quantum encryption.
[...]
What about the YubiKey plugin?
age-plugin-yubikey 0.6.0 can generate new hybrid post-quantum keys on all supported YubiKeys.
The post-quantum component of these keys is stored PIN-protected on the YubiKey, and the public keys and files are secure against quantum computers. However, an attacker with a quantum computer can bypass touch enforcement and extract the key with access to the YubiKey and the PIN. This is the best that can be done until hardware support for ML-KEM is rolled out.
What about other plugins?
age v1.4.0 and rage 0.13.0 warn about encrypting files using plugins that don’t actively assert post-quantum security.
Please refer to the documentation of each plugin for guidance.
Plugin authors are encouraged to implement either age1tagpq1… or age1pq1…
public keys, which also avoid the need for the plugin at encryption time, or to
assert the postquantum label.
Note that a new mlkem768p256tagv2 stanza type was recently
introduced.
What about SSH keys?
Encrypting to SSH keys was always a hack, because SSH keys are authentication keys, not encryption keys. With RSA and ECC, there was a way to use an authentication key pair to encrypt. With post-quantum algorithms, there is not.
Encrypting to SSH keys is over.
What about library use?
The filippo.io/age Go module and age Rust crate also support post-quantum
keys from age v1.3.0 and rage 0.13.0. They do not print warnings to stderr.
From age v1.4.0 and rage 0.13.0, generating and encrypting to legacy non-PQ keys
is deprecated. Note that Go and Rust deprecations do not remove support or
change runtime behavior; they are only surfaced by IDEs and linters. The Rust
crate also provide legacy and legacy-decrypt build-time feature flags,
currently enabled by default.