NTE_BAD_KEY_STATE (0X8009000B) – Quick Fix and Why It Happens
This error means Windows can't use a cryptographic key because it's in the wrong state. The fix is usually a simple key reset or account repair.
NTE_BAD_KEY_STATE. It's cryptic, it's annoying, and it usually pops up when you're trying to do something simple—like log in with a Microsoft account, unlock a BitLocker drive, or connect to a VPN. You're not alone. This error's been around since Windows 8, and it still trips up Windows 11 users today.
The Fix That Works 90% of the Time
The most common cause is a corrupted Microsoft account credential cache. Your local machine stores a copy of your account's cryptographic keys, and sometimes that copy gets out of sync with what Microsoft's servers expect. Here's how to reset it:
- Open Credential Manager. Press Win+R, type
control /name Microsoft.CredentialManager, hit Enter. - Click Windows Credentials.
- Look for any entry under Generic Credentials that contains your Microsoft account email or the string
MicrosoftAccount. Delete those entries. - Restart your PC. The next time you try to sign in (to any Microsoft service), Windows will prompt you for your password and re-generate fresh keys.
That's it. No registry hacks, no command-line voodoo. The reason this works is that Credential Manager caches both the encrypted password and the public/private key pair used by Windows for authentication. When the key state is 'bad', it's usually because the cached key doesn't match the server's current key. Deleting the cached entry forces a clean handshake.
Why Step 3 Works Specifically
What's actually happening here is that the NTE_BAD_KEY_STATE error comes from the Microsoft Platform Crypto Provider (under the hood, it's part of ncrypt.dll). This provider manages key usage states: valid, expired, revoked, and pending. Your key is stuck in a state that doesn't match what the provider expects for the operation you're trying to perform. Deleting the credential forces the provider to regenerate a fresh key pair with a clean state value.
One small detail: if you're using Windows Hello (PIN, fingerprint, face), you'll also need to re-set up those biometrics after deleting credentials. They're tied to the same key store.
When Credential Manager Doesn't Cut It
Sometimes the issue runs deeper. Here are the less common variations and how to handle each:
BitLocker Recovery Key Mismatch
You see the error when trying to unlock a BitLocker drive, even though you typed the correct recovery key. This isn't a credential cache problem—it's a TPM (Trusted Platform Module) issue. The TPM stores the key in a sealed state, and that seal can break after a BIOS update or hardware change. Fix it by running:
manage-bde -protectors -delete C: -type TPM
manage-bde -protectors -add C: -TPMReplace C: with your drive letter. This tells BitLocker to re-seal the key with the current TPM state. You'll need admin rights.
VPN or RDP Certificate Mismatch
Some VPN clients (like Cisco AnyConnect) or Remote Desktop use certificates stored in the Machine certificate store. If the certificate's private key is suddenly marked as unusable, you get 0X8009000B. The fix here is to re-import the certificate or request a new one from your IT admin. You can check the certificate's status with:
certlm.mscNavigate to Personal > Certificates. Find the problematic cert, double-click, and check the General tab. If it says You have a private key that corresponds to this certificate but the key is listed as 'not available' in the next line, you're in this scenario. Delete and re-import.
Corrupted User Profile
If you've tried the Credential Manager fix and the BitLocker fix and you're still getting the error, your user profile's cryptographic store (%APPDATA%\Microsoft\Crypto\RSA) might be corrupted. You can try creating a new local admin account and migrating your data. Honestly, this is rare—I've seen it twice in five years—but it's worth knowing.
Prevention: Keep Your Keys Clean
The error usually traces back to one of three things: an interrupted key creation (like a failed Windows Hello setup), a credential sync conflict (if you sign in on multiple machines), or a third-party tool messing with the credential store (looking at you, password managers from 2015). To avoid this:
- Do a sign-out / sign-in from your Microsoft account at least once a month. That syncs the key store.
- If you use a password manager that integrates with Windows Hello, make sure it's updated. Older versions sometimes overwrite credential files.
- After a BIOS or firmware update, run
tpm.mscand check that the TPM is 'Ready'. If it's not, initialize it via the Actions pane.
One last thing: don't bother with third-party 'registry cleaners' for this error. They don't touch the credential store, and they'll only waste your time. Stick to the steps above. They've been fixing this since Windows 8.1, and they still work today.
Was this solution helpful?