
The Problem with Passwords
Passwords are the oldest form of digital authentication. They are also the weakest. According to the Verizon 2024 Data Breach Investigations Report, over 80% of hacking-related breaches involve stolen, weak, or reused credentials. Passwords fail because they are "something you know," and things you know can be extracted from you in many ways:
- Phishing: An attacker sends you a fake login page. You type your password, and they capture it. This is the most common attack vector in the world.
- Keyloggers: Malware running on your computer records every keystroke. When you type your encryption password, the keylogger captures it and sends it to the attacker.
- Shoulder surfing: Someone watches you type your password. In an office, a coffee shop, or on a plane, this is easier than most people realize.
- Database breaches: You reuse the same password across services (most people do). One of those services gets hacked, and the attacker now has your password for everything.
- Social engineering: An attacker calls you pretending to be IT support and asks for your password. It works more often than you would think.
- Brute force: If your password is short or common, an attacker can simply try every possibility. Modern GPUs can test billions of password guesses per second against common algorithms.
When it comes to data encryption, the consequences of a stolen password are total. If someone gets your QNSQY password, they can decrypt every file you encrypted with that password, from anywhere in the world, at any time. They do not need access to your computer. They just need the encrypted file (which might be sitting on a cloud backup, a USB drive, or a shared server) and your password.
QNSQY's Argon2id password hashing makes brute-force attacks extremely difficult (each guess requires 128-512 MB of RAM and significant CPU time), but it cannot protect against a password that was phished, keylogged, or socially engineered. Once the attacker has the actual password, Argon2id does not help.
This is where hardware security keys change the equation.
What Is a Hardware Security Key?
A hardware security key is a small physical device, usually the size of a USB thumb drive, that contains a cryptographic chip. The most well-known brand is YubiKey, made by Yubico, but many manufacturers produce compatible devices.
The key stores a secret (a private cryptographic key) inside a tamper-resistant chip. This secret never leaves the device. When an application needs to verify your identity, it sends a challenge to the key, and the key uses its internal secret to compute a response. The application can verify the response is correct without ever seeing the secret itself.
Think of it like a sealed envelope. You can ask someone to write a message, seal it in the envelope, and hand it to you. You can verify the message is correct by checking through a special window. But you can never open the envelope and see the pen inside. The pen (the private key) never leaves its sealed container (the hardware chip).
This is fundamentally different from a password:
- A password is "something you know" and can be copied, shared, intercepted, or guessed. Once an attacker knows it, they have it forever.
- A hardware key is "something you have" and cannot be copied. The private key is burned into the chip during manufacturing and cannot be extracted even with physical access to the device. To use it, you must physically possess the key and physically touch it.
What Is FIDO2?
FIDO2 is an open authentication standard developed by the FIDO Alliance, a consortium that includes Google, Microsoft, Apple, Yubico, and dozens of other companies. It was designed from the ground up to be phishing-resistant.
FIDO2 consists of two components:
- WebAuthn (Web Authentication API): The browser/application-side protocol, standardized as a W3C Recommendation.
- CTAP2 (Client to Authenticator Protocol): The protocol between your computer and the physical key, standardized by the FIDO Alliance.
When you register a FIDO2 key with an application, the key generates a unique public/private key pair for that specific application. The private key stays on the device. The public key is given to the application. During authentication, the application sends a random challenge, the key signs it with the private key, and the application verifies the signature with the public key.
Why is this phishing-resistant? Because the key pair is bound to the specific application's identity (its origin). If a phishing site pretends to be your bank, the key will not respond because the phishing site has a different origin than the real bank. The key simply refuses to authenticate. This happens at the hardware level; you do not need to spot the fake URL yourself.
NIST SP 800-63B (Digital Identity Guidelines) classifies hardware-bound authenticators at Authenticator Assurance Level 2 (AAL2) and, with additional protections, at AAL3 (the highest level). AAL3 requires a hardware-based authenticator that provides verifier impersonation resistance, which is exactly what FIDO2 delivers.
How QNSQY Uses Hardware Keys
When you enable hardware key authentication in QNSQY (a Business tier feature), the encryption workflow changes from single-factor to two-factor:
- Registration (one-time setup): You plug in your YubiKey and register it with QNSQY. This generates a unique FIDO2 credential on the key, tied to QNSQY's application identity. You touch the key to confirm. QNSQY stores the public key portion; the private key stays on the YubiKey.
- Encryption: When you encrypt a file, QNSQY sends a cryptographic challenge to your YubiKey. You touch the key to authorize the response. The key's response is combined with your password through HKDF (HMAC-based Key Derivation Function) to produce the final encryption key. This means the encryption key depends on both your password AND the YubiKey's secret. Neither alone produces the correct key.
- Decryption: To decrypt, you need your password AND your YubiKey must be physically present and touched. QNSQY sends the same challenge, the key produces the same response (it is deterministic), and combined with the correct password, it regenerates the decryption key.
The critical security property: even if an attacker has your password, they cannot decrypt your files without physical possession of your specific YubiKey. And even if someone steals your YubiKey, they cannot decrypt your files without also knowing your password. Both factors must be present simultaneously.
Current Status and Setup
Native FIDO2 integration as a direct encryption factor is an upcoming Business tier feature. In the meantime, you can achieve similar hardware-bound security by storing QNSQY encryption keys on a YubiKey's PIV (Personal Identity Verification) smart card interface:
CLI Approach (Available Now)
# Generate an encryption keypair
qnsqy keygen-enc -o mykey -n "Hardware-Bound Key"
# Import the private key to your YubiKey's PIV slot using ykman
# (YubiKey Manager must be installed separately)
# The private key is then stored on the YubiKey hardware
# Encrypt using the public key (no YubiKey needed for encryption)
qnsqy encrypt -i secret.txt --recipient mykey.pub
# Decrypt requires the private key from the YubiKey
qnsqy decrypt -i secret.txt.qs --key mykey
This approach uses the YubiKey's PIV applet as a hardware-protected key store. The private key is stored on the YubiKey and operations that need it require the YubiKey to be physically present.
GUI Approach
- Go to Settings, then Security, then YubiKey
- Insert your YubiKey and click "Register"
- Touch the key when the YubiKey blinks (this confirms physical presence)
- Enable "Require YubiKey for encryption"
Once registered, any encryption or decryption operation in the GUI will prompt you to touch your YubiKey before proceeding.
Supported Hardware Keys
QNSQY works with any FIDO2-compatible security key. The FIDO2 standard is manufacturer-agnostic, so you are not locked into any single brand. Compatible keys include:
- YubiKey 5 series (5 NFC, 5C, 5Ci, 5C NFC): The most widely deployed hardware security keys in the world. Support FIDO2, PIV, HMAC-SHA1, and many other protocols. Available in USB-A, USB-C, and Lightning form factors. Recommended for most users.
- YubiKey Security Key series: A lower-cost option that supports FIDO2/U2F only (no PIV or HMAC-SHA1). Suitable if you only need the FIDO2 authentication factor.
- Feitian ePass FIDO2: A FIDO2-certified key from a Chinese manufacturer. Available in USB-A and NFC variants.
- SoloKeys Solo 2: An open-source hardware security key. The firmware source code is publicly available for audit, which appeals to users who want to verify what their key is running.
- Google Titan Security Key: Google's own FIDO2 key, available in USB-A/NFC and USB-C/NFC variants. Uses a secure element codesigned by Google.
- Nitrokey FIDO2: An open-source key manufactured in Germany. Popular in European government and enterprise deployments.
Keys with PIN support (which includes all YubiKey 5 series and most modern FIDO2 keys) provide an additional layer: even if someone steals your physical key, they cannot use it without also knowing the PIN. This turns the key into a two-factor device on its own: something you have (the key) plus something you know (the PIN).
What Happens If You Lose Your Key
This is the most important section of this article. Read it carefully.
If you lose your YubiKey, and you have no backup, files encrypted with that key are permanently inaccessible. There is no recovery mechanism, no master key, no backdoor, and no customer support override. The private key that was inside the YubiKey is gone, and without it, the encryption cannot be reversed. This is not a limitation; it is the fundamental security property you are paying for.
To protect yourself against key loss:
- Always register a backup key. QNSQY supports registering multiple YubiKeys for the same credential. Buy two keys of the same model. Register both. Store the backup in a physically separate, secure location.
- Use a safety deposit box for the backup key. A fireproof home safe is also acceptable. The backup should survive the same scenarios that might destroy your primary key (house fire, theft, flood).
- Use M-of-N threshold encryption (Business tier). Split the decryption capability among multiple people. For example, 3-of-5 threshold encryption means any three of five designated people can cooperate to decrypt, so losing one or two keys does not cause data loss.
- Keep a record of which files were encrypted with which key. If you have some files encrypted with password-only and others with YubiKey-bound encryption, knowing which is which prevents confusion during a recovery scenario.
The rule of thumb: treat your backup YubiKey with the same seriousness as a backup of your hard drive. If you would not be comfortable losing all your encrypted data, you need a backup key.
How the Cryptography Works (Simplified)
When QNSQY uses a YubiKey for encryption, the final encryption key is derived from two independent sources combined through HKDF-SHA3-256:
- Your password, processed through Argon2id to produce a password-derived key. This is the same process used in password-only encryption.
- The YubiKey's HMAC-SHA1 challenge-response. QNSQY sends a random challenge to the key's HMAC-SHA1 slot. The key computes HMAC-SHA1 of the challenge using its internal secret. The result is a 20-byte value that depends on the key's secret, which never leaves the hardware.
These two values are combined through HKDF (HMAC-based Key Derivation Function, specified in RFC 5869) to produce the final AES-256-GCM encryption key. The math ensures that knowing only one of the two inputs reveals nothing about the final key. You need both.
The HMAC-SHA1 approach works completely offline. There is no server communication, no certificate authority, and no internet connection required. The challenge-response happens directly between your computer and the YubiKey over USB. This makes it compatible with air-gapped workflows.
The challenge-response is also deterministic: the same challenge always produces the same response from the same key. This is essential for encryption, because you need to regenerate the exact same key during decryption. FIDO2's standard authentication flow uses nonces that change every time (good for login, bad for encryption), which is why QNSQY uses the HMAC-SHA1 slot for the actual key derivation and FIDO2 for the physical presence check.
Password-Only vs. YubiKey: A Comparison
Here is a concrete comparison of what an attacker needs under each mode:
| Attack Scenario | Password-Only | Password + YubiKey |
|---|---|---|
| Attacker knows your password | Can decrypt | Cannot decrypt (no key) |
| Attacker steals your YubiKey | Not applicable | Cannot decrypt (no password) |
| Attacker has both password and key | Can decrypt | Can decrypt |
| Attacker brute-forces your password | Theoretically possible (Argon2id makes it very hard) | Impossible (even correct password is insufficient) |
| Database breach leaks your password | At risk | Safe (key is not in any database) |
| Phishing captures your password | At risk | Safe (FIDO2 is phishing-resistant) |
The YubiKey does not make weak passwords acceptable. It adds a second layer so that even if the password layer fails completely, the data remains protected. Use a strong password AND a hardware key for the best security.
Who Should Use Hardware Keys
Hardware key authentication is most valuable for:
- Organizations handling regulated data: HIPAA (healthcare), PCI DSS (payment cards), GDPR (EU personal data), and CMMC (defense contractors) all recommend or require multi-factor authentication for access to sensitive data.
- Executives and high-value targets: C-suite executives, board members, and other high-profile individuals are disproportionately targeted by spear-phishing. A hardware key neutralizes these attacks.
- Shared workstations: If multiple people use the same computer, a hardware key ensures that even if the computer is compromised, the attacker needs physical possession of a specific person's key to decrypt their files.
- Anyone encrypting data they absolutely cannot afford to have breached: Medical records, legal documents, financial records, trade secrets, journalism source material.
Practical Tips for Using Hardware Keys
If you decide to use a hardware key with QNSQY, these practical recommendations will save you headaches:
- Buy at least two keys. One primary, one backup. Register both with QNSQY at the same time. Store the backup in a different physical location than the primary. If your house burns down and both keys are in the same drawer, you have lost access to your data.
- Set a PIN on your key. Most modern FIDO2 keys support a user-configurable PIN (typically 4 to 8 characters). With a PIN enabled, a stolen key is useless without the PIN. After several wrong PIN attempts, the key locks itself permanently. This turns the key into its own two-factor device: the key itself is something you have, and the PIN is something you know.
- Label your keys. If you have multiple YubiKeys (personal, work, backup), put a physical label or colored sticker on each one. When QNSQY asks you to touch your key, you need to touch the right one.
- Keep a written record of which files are key-protected. If some files use password-only encryption and others use password-plus-YubiKey, you need to know which is which before attempting decryption.
- Do not leave your key plugged into your computer when not in use. The point of a hardware key is physical access control. If it is always plugged in, it provides no additional security over a password. Remove it after each encryption/decryption operation.
Hardware Keys and Air-Gapped Encryption
Hardware keys pair exceptionally well with air-gapped workflows. Because the HMAC-SHA1 challenge-response happens entirely between your computer and the key over USB, with no server communication, it works on machines with no internet connection. You get the security benefit of two-factor authentication even on a completely isolated machine.
The typical workflow: bring your YubiKey and a USB drive to the air-gapped machine. Plug in the YubiKey. Encrypt your files (which requires both your password and a touch of the key). Remove the YubiKey. Copy the encrypted files to the USB drive. The encrypted files can then be transported to networked systems, where they are safe even if those systems are compromised, because decryption requires the YubiKey that is back in your pocket.
Sources
- FIDO Alliance FIDO2 Specifications - https://fidoalliance.org/specifications/
- W3C Web Authentication (WebAuthn) Level 2 - https://www.w3.org/TR/webauthn-2/
- NIST SP 800-63B: Digital Identity Guidelines, Authentication and Lifecycle Management - https://pages.nist.gov/800-63-4/sp800-63b.html
- RFC 5869: HMAC-based Extract-and-Expand Key Derivation Function (HKDF) - https://www.rfc-editor.org/rfc/rfc5869
- Yubico Developer Documentation: HMAC-SHA1 Challenge-Response - https://developers.yubico.com/yubico-pam/YubiKey_and_HMAC-SHA1_Challenge-Response.html
Related Articles
- Linux GUI Security: Achieving 100/100
- Air-Gapped Encryption: Best Practices
- Getting Started with QNSQY CLI
Hardware Security - Coming Soon
YubiKey integration is a planned feature for a future QNSQY release. In the meantime, use public-key encryption with keypairs stored on YubiKey via PIV.
Get QNSQY BusinessOriginally published at quantumsequrity.com/blog/yubikey-integration.