Is Your .NET SFTP Code Post-Quantum Ready? 3 Checks Before Your Server Flags You

OpenSSH 10.6 servers now log a warning every time a client connects without post-quantum key exchange. This guide shows how to make your .NET SFTP code post-quantum ready with ML-KEM, prove it on the wire, and fail closed when a server can’t keep up.

Your SFTP server may already be logging that your app isn’t post-quantum ready. Since OpenSSH 10.6, sshd flags every client that connects without a post-quantum key exchange. We connected a .NET client with default settings, and the server wrote this:

WARNING: connection from 172.17.0.1 port 38390 is not using a post-quantum key exchange algorithm: "ecdh-sha2-nistp256" [preauth]

So “are we post-quantum ready?” is now a grep away for any auditor. Here’s how to get post-quantum SFTP working in C#, and three checks that prove it.

The short answer

  • Post-quantum SFTP means the SSH handshake uses a hybrid key exchange such as mlkem768x25519-sha256, which pairs ML-KEM-768 with X25519.
  • OpenSSH has offered that hybrid since 9.9 and has preferred it since 10.0. Since 10.6, the server also logs a warning for every client that doesn’t use it.
  • Xceed SFTP for .NET 7.4 supports the hybrid, but with default settings it still negotiates classical ECDH. One call to KeyExchangeAlgorithmList.MoveToFirst changes that.
  • We tested everything below on December 4, 2026 with Xceed SFTP for .NET 7.4.26464.8497, .NET 10, OpenSSH 10.6, and OpenSSH 9.6.

Post-quantum terms in this article

ML-KEM – the NIST key encapsulation standard (FIPS 203), formerly called Kyber.

mlkem768x25519-sha256 – the SSH hybrid key exchange that pairs ML-KEM-768 with X25519.

Harvest now, decrypt later – recording encrypted traffic today to break it with a future quantum computer.

Post-quantum ready – your handshake already uses a key exchange built to resist a quantum computer.

Why is everyone suddenly asking for “post-quantum ready”?

Three things changed in the last two years, and together they turned a research topic into a checklist item.

First, NIST published FIPS 203 on August 13, 2024. That standard defines ML-KEM, a key encapsulation mechanism built on lattice math that no known quantum computer attack can shortcut. As a result, vendors finally had a stable algorithm to ship.

Second, OpenSSH moved fast. Version 9.9 added mlkem768x25519-sha256 in September 2024, and 10.0 made it the default in April 2025. Then 10.1 started warning users on the client side, while 10.6 added the server-side log line you saw above. The OpenSSH post-quantum page explains the reasoning in plain terms.

Third, governments set dates. For example, the UK NCSC migration timeline asks organizations to finish discovery and planning by 2028, migrate priority systems by 2031, and complete the move by 2035. Meanwhile, NIST finalized IR 8547 in October 2026, its plan for retiring today’s public-key algorithms.

The threat is already recording your traffic

A quantum computer that can break today’s key exchange doesn’t exist yet. OpenSSH cites estimates from 5 to 20 years, with many observers expecting the mid-2030s. So why rush? The answer is harvest now, decrypt later.

An attacker can copy your encrypted SFTP traffic today and store it cheaply. Later, a quantum computer running Shor’s algorithm could break the classical key exchange and recover the session key. After that, every file in the capture opens up. If you move payroll files, medical records, or source code that must stay private past 2035, that recording is already a liability.

The weak spot is the key exchange

Importantly, the weak spot is the key exchange, not the file encryption. AES and ChaCha20 hold up well against quantum attacks, whereas ECDH and RSA don’t. That’s why post-quantum work in SSH starts with key exchange.

What does post-quantum SFTP mean on the wire?

Every SFTP session starts with an SSH handshake. During that handshake, client and server agree on a shared secret, and everything after it depends on that secret.

A post-quantum SFTP connection runs a hybrid key exchange called mlkem768x25519-sha256. It combines ML-KEM-768 with classical X25519, then hashes both results with SHA-256. Because of this design, the session stays safe as long as either half holds. If someone finds a flaw in the new lattice math, X25519 still protects you. On the other hand, if a quantum computer breaks X25519, the lattice half still protects you.

There’s one catch, and it’s the reason for this article. SSH negotiation follows the client’s preference order. Specifically, the server picks the first algorithm on the client’s list that it also supports. So a client can support ML-KEM and still never use it.

Xceed SFTP for .NET: ML-KEM is in the box

Xceed SFTP pour .NET added mlkem768x25519-sha256 in version 7.4. It’s a single NuGet package that targets .NET Framework and modern .NET, so you don’t need a native OpenSSH install on the client:

Install the NuGet package

dotnet add package Xceed.Products.SFtp.Full

Our demo project targets .NET 10:

Project configuration

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>
 
  <ItemGroup>
    <PackageReference Include="Xceed.Products.SFtp.Full" Version="7.4.26464.8497" />
  </ItemGroup>
</Project>

Set your license key before the first connection. The package compiles without one but throws at runtime. You can get a key with the 45-day free trial:

Xceed.SSH.Client.Licenser.LicenseKey = "YOUR-LICENSE-KEY-HERE";

Check 1: see what your client negotiates today

Before you change anything, measure. After the handshake, the SSHClient exposes the algorithm it actually agreed on. These lines come straight from the demo:

Inspect the negotiated algorithms

ssh.Connect(host, port);
ssh.Authenticate(user, password);
 
Console.WriteLine($"   Server:       {ssh.ServerIdentificationSoftwareVersion}");
Console.WriteLine($"   Key exchange: {ssh.ActiveKeyExchangeAlgorithmString}");
Console.WriteLine($"   Cipher:       {ssh.ActiveEncryptionAlgorithmClientToServerString}");

We ran this against OpenSSH 10.6 with the library defaults. Here’s the output:

1) Stock defaults
   Server:       OpenSSH_10.6
   Key exchange: Xceed.SSH.Protocols.EllipticCurveDiffieHellmanKeyExchange/nistp256
   Cipher:       aes128-ctr

Classical ECDH won, even though both sides support the hybrid. The reason is ordering. In 7.4, the default list includes mlkem768x25519-sha256, but it sits seventh, behind the elliptic-curve entries. Consequently, the server picks the first classical match, and its log records the warning.

Check 2: put ML-KEM first

The fix takes one line. The algorithm lists on SSHClient are read-only properties, but you can reorder the list they return:

Prefer post-quantum key exchange

static void PreferPostQuantum(SSHClient ssh)
{
  // Put mlkem768x25519-sha256 at the top of the client's list.
  // SSH picks the first client algorithm the server also supports.
  ssh.KeyExchangeAlgorithmList.MoveToFirst(SSHKeyExchangeMethods.MLKem768X25519Sha256);
}

Call it before Connect, and the same server now agrees on the hybrid key exchange:

2) Prefer the post-quantum hybrid
   Server:       OpenSSH_10.6
   Key exchange: mlkem768x25519-sha256
   Cipher:       aes128-ctr

This mode still falls back to classical ECDH when a server lacks the hybrid. That makes it a safe default for apps that talk to many partners, since old servers keep working while new ones get post-quantum SFTP.

Check 3: fail closed when it matters

Sometimes fallback is the risk. For instance, if a contract or audit demands post-quantum SFTP, a silent downgrade breaks that promise. In that case, offer only the hybrid:

Require post-quantum key exchange

static void RequirePostQuantum(SSHClient ssh)
{
  // Offer only the hybrid. A server without ML-KEM fails the
  // handshake instead of silently falling back to classical ECDH.
  ssh.KeyExchangeAlgorithmList.Reset(new[] { SSHKeyExchangeMethods.MLKem768X25519Sha256 });
 
  // Prefer AES-256 too. This list starts with aes256-gcm@openssh.com.
  ssh.EncryptionAlgorithmList.Reset(SSHEncryptionMethods.HighSecurityEncryptionMethods);
}

Against OpenSSH 10.6, the session negotiates the hybrid, picks AES-256-GCM, and uploads the file:

3) Require the post-quantum hybrid, then upload a file
   Server:       OpenSSH_10.6
   Key exchange: mlkem768x25519-sha256
   Cipher:       aes256-gcm@openssh.com
   Uploaded:     \home\demo\upload\invoice-2026-12.csv (22 bytes)

However, a server limited to classical algorithms gets a clear refusal instead of a quiet downgrade:

Handshake failure output

Handshake failed: ChooseKeyExchangeAlgorithm() could not decide on an algorithm.
Client list: mlkem768x25519-sha256
Server list: curve25519-sha256, ecdh-sha2-nistp256, ext-info-s, kex-strict-s-v00@openssh.com

That error message lists both sides’ algorithms, which makes the support ticket to your partner a short one.

The upload itself doesn’t change

After the handshake, nothing about your file code changes. SFtpFolder and DiskFile work the way they always have:

Upload a file using SFTP

using var sftp = new SFtpSession(ssh);
 
var local = new DiskFile(localPath);
var remoteFolder = new SFtpFolder(sftp, "/home/demo/upload");
local.CopyTo(remoteFolder, true);

In other words, post-quantum SFTP is a connection setting, not a rewrite.

Prefer vs. require: which mode to ship

Situation Mode What happens with an old server
Many partners, mixed server versions Prefer (MoveToFirst) Falls back to classical ECDH
Regulated data, contract says post-quantum Require (Reset) Handshake fails with both lists
Internal servers you control Require Upgrade the server to OpenSSH 9.9 or later
Library defaults, no change Neither Classical ECDH, server logs a warning

What this doesn’t cover

Being honest about scope matters here, because “post-quantum” gets stretched in marketing copy.

  • Host keys and signatures stay classical. In our test, the server still proved its identity with ecdsa-sha2-nistp256. That’s acceptable for now, since an attacker can’t forge a signature retroactively, so recorded traffic gains nothing. OpenSSH 10.6 enabled the hybrid ssh-mldsa44-ed25519 signature, and Xceed SFTP 7.4 doesn’t support it yet.
  • Only one hybrid works today. Xceed SFTP 7.4 negotiates mlkem768x25519-sha256 but not the older sntrup761x25519-sha512. OpenSSH servers older than 9.9 offer only sntrup761. We tried OpenSSH 9.6, and the client ended up on classical ECDH there.
  • This is not “quantum encryption”. File data still flows through AES. The hybrid key exchange protects the session key, and that’s the part a quantum computer would attack.
  • Your server must support it too. No client setting fixes an old server. Run sshd -T on the server and look for mlkem768x25519-sha256 on the kexalgorithms line.
  • It doesn’t make you CNSA 2.0 compliant. That NSA profile asks for ML-KEM-1024, while this hybrid uses the 768 parameter set.

Get started

Download the Xceed SFTP for .NET trial, add the MoveToFirst line, and log ActiveKeyExchangeAlgorithmString on every connection. Then check your server logs for the OpenSSH warning. If it’s gone, your transfers use a post-quantum key exchange.

For background on the threat model, read our earlier posts on post-quantum key exchange in SSH et classical key exchange in the quantum era. The package itself lives on NuGet.

Try Xceed SFTP for .NET free for 45 days

Add one line to your connection setup and make your file transfers post-quantum ready today.

Questions fréquemment posées

What does “post-quantum ready” mean for SFTP?

It means your SSH handshake uses a key exchange built to resist a future quantum computer, such as the hybrid mlkem768x25519-sha256. In practice, you can prove it when your client logs that algorithm after connecting and your server stops logging the OpenSSH “not using a post-quantum key exchange” warning.

Is Xceed SFTP for .NET post-quantum ready?

Yes, from version 7.4, for key exchange. Xceed SFTP for .NET 7.4 supports the hybrid mlkem768x25519-sha256, although you must move it to the top of the key exchange list to use it. Host key signatures remain classical for now.

How do I enable ML-KEM key exchange in C#?

With Xceed SFTP for .NET 7.4, call KeyExchangeAlgorithmList.MoveToFirst on your SSHClient before you connect, and pass SSHKeyExchangeMethods.MLKem768X25519Sha256. Then read ActiveKeyExchangeAlgorithmString after connecting to confirm that the server agreed.

Is ML-KEM the same as Kyber?

Mostly, yes. NIST standardized CRYSTALS-Kyber as ML-KEM in FIPS 203, with small changes to the final spec. The SSH method mlkem768x25519-sha256 uses the FIPS 203 version at the 768 parameter set.

Does post-quantum SFTP slow down file transfers?

No, not in a way you’ll notice. The hybrid adds a little over 2 KB to the handshake and a little CPU work once per connection. After that, bulk transfer uses the same AES cipher as before.

Which SSH servers support mlkem768x25519-sha256?

OpenSSH has supported it since version 9.9, and it’s the default from 10.0 onward. Therefore, any server on a current Linux distribution with OpenSSH 10 offers it. For other servers, run sshd -T or check the vendor’s release notes.

Do I need to change my SFTP upload code?

No. The change lives in connection setup, where one line reorders the key exchange list. As a result, your SFtpFolder, SFtpFile, and DiskFile code stays exactly the same.

Is AES-128 still safe against quantum computers?

Grover’s algorithm weakens symmetric keys, but AES-128 remains acceptable under current NIST guidance. Still, if you want extra margin, prefer AES-256. The HighSecurityEncryptionMethods list in Xceed SFTP puts aes256-gcm@openssh.com first.

Découvrez la bibliothèque de mots et PDF de Xceed paquet