Basic post-quantum mitigations on Windows 11

Share

DISCLAIMER: I'm not a cryptography expert. I just like to experiment, and hopefully dodge the first salvo of encyrption attacks. Also, the instructions here might break things; use at your own discretion. This article assumes you're running Windows 11 26H2.

Windows is a bit behind in the post-quantum race that was heated by the US government's latest announcement that all encyrption must transition to post-quantum despite that Microsoft is one of the signatories of the joint letter about the urgency of the matter.

Web browsers are ok

Mainstream web browsers like Chrome, Edge, Firefox have already ML-KEM based hybrid key exchange mechanisms enabled by default. As long as the server you connect to supports it, they'll establish communication through quantum-resistant algorithms.

SSH client

First issue with Windows is that the built-in OpenSSH client is quite outdated. It doesn't support post-quantum algorithms.

PS D:\>ssh -V
OpenSSH_for_Windows_9.5p2, LibreSSL 3.8.2

Good thing is that you have several options. First one is:

If you have the latest Git

Git already comes with its own SSH (MSys2 build) and it's quite current. So, instead of using Microsoft's SSH, you can just add Git SSH's folder C:\Program Files\Git\usr\bin at the end of your PATH. You can use environment variable editor UI, or just type this on PowerShell:

[Environment]::SetEnvironmentVariable('PATH', [Environment]::GetEnvironmentVariable('PATH','User') + ';C:\Program Files\Git\usr\bin', 'User')

No git?

If you don't have Git, you can install a newer version provided by Microsoft. It's a preview release, but better than all other third-party alternatives. You can install it with:

winget install Microsoft.OpenSSH.Preview

Microsoft's version doesn't support stabilized ML-DSA keys, so, you can only use it for ML-KEM, but it's better than nothing for sure. Current version of Microsoft.OpenSSH.Preview is 10.4p1.

Uninstall the built-in OpenSSH

If you have the built-in OpenSSH for Windows, you also need to remove that to avoid the confusion between the two:

dism /online /Remove-Capability /CapabilityName:OpenSSH.Client~~~~0.0.1.0

OpenSSH 10.0 and later will automatically prioritize quantum-resistant ML-KEM key exchange over any other schemes.

Also, note that your client won't do anything different if you also don't upgrade SSH servers to their latest versions. For instance, my Synology NAS, despite being supported, comes with a very old sshd. It doesn't matter which client I have. But, the good thing is, you'll get a warning for that whenever you connect to a server that's not post-quantum ready.

** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html

Make Bitlocker stronger

Bitlocker uses XTS-AES-128 by default. AES is normally considered quantum-safe, but its strength is halved by Grover's algorithm on quantum computers, so becomes an order of magnitude weaker cipher (64-bit) post-quantum. You can increase its strength by re-encrypting your drive with XTS-AES-256. In order to do that:

  • Step 1: Turn off Bitlocker on all drives
  • Step 2: Enable XTS-AES-256 for all drive types. Note that these schemes aren't compatible with pre-Windows 11.
reg add "HKLM\SOFTWARE\Policies\Microsoft\FVE" /v EncryptionMethodWithXtsOs  /t REG_DWORD /d 7 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\FVE" /v EncryptionMethodWithXtsFdv /t REG_DWORD /d 7 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\FVE" /v EncryptionMethodWithXtsRdv /t REG_DWORD /d 7 /f
  • Step 3: Turn Bitlocker back on. Backup your recovery keys.

Protect WireGuard

Set a Pre-Shared Key (PSK) on all your WireGuard clients. Even if it's encryption is broken, PSK makes it orders of magnitude harder. WireGuard v2 is coming, keep an eye out for that too.

Fix remaining Windows apps

All apps that use Windows APIs to make HTTPS connections rely on a component called Schannel (Secure Channel). To see if you have ML-KEM prioritized in Schannel, run Get-TlsEccCurve Powershell cmdlet:

PS C:\>Get-TlsEccCurve
curve25519
NistP256
NistP384

Since I don't have any ML-KEM based key exchange mechanisms enabled, I enable one and put it at the top.

Enable-TlsEccCurve x25519_mlkem768 -Position 0

This enables a hybrid key exchange mechanism by default for all apps that use Schannel, and suddenly most your apps are post-quantum ready. Add another hybrid exchange right below X25519:

Enable-TlsEccCurve secp256r1_mlkem768 -Position 1

Windows also supports pure ML-KEM. You can enable it too. Add it right below the hybrid key exchange algorithms:

Enable-TlsEccCurve mlkem768 -Position 2

The final list should look like:

PS D:\>Get-TlsEccCurve
x25519_mlkem768
secp256r1_mlkem768
mlkem768
curve25519
NistP256
NistP384

The reason we put hybrid exchanges before pure ML-KEM is that it's still considered a bit more secure since it requires both algorithms to be defeated in order to be fully cracked.

You can test it with curl version that uses Schannel:

PS D:\>curl -V
curl 8.23.0 (Windows) libcurl/8.23.0 Schannel zlib/1.3.2 WinIDN WinLDAP

PS D:\>curl -s https://www.cloudflare.com/cdn-cgi/trace | Select-String "kex|tls"

tls=TLSv1.3
kex=X25519MLKEM768

That output shows that curl app was able to establish a connection using hybrid quantum-resistant algorithm X25519MLKEM768. If you run Disable-TlsEccCurve against it, you'll see that it will connect with a different algorithm.

Note that ML-KEM and/or hybrid key exchange mechanisms have some network overhead. Look at this comparison for example:

Client sendsServer sends
X2551932 bytes32 bytes
X25519MLKEM7681,216 bytes1,120 bytes

So, it's already larger than a typical network packet at the beginning. That means more roundtrips, so longer connection times for the sake of security.

Your web browsers already default to that though. So, that's something that only affects native Windows apps, or say, Windows Update, and so forth. You won't even probably notice. And no, it doesn't impact your multiplayer games at all as they don't use TLS. Just know the difference, be aware of it.

I'm sure that after NSA's announcement companies have now scrambled to enable post-quantum support everywhere. So, don't worry too much about it if you don't want to make any changes to your systems. You'll probably get similar fixes in the upcoming months.