ML-KEM in .NET 10, What the Framework Gives and What a Library Adds

.NET 10, released on 11 November 2025 and supported until November 2028, is the first .NET with post-quantum cryptography built in. The MLKem class is there, it is not marked experimental, and a key exchange takes a few lines. For a .NET team, that is a real step forward. It is also where the framework stops.

What the framework gives

MLKem implements FIPS 203 with its three parameter sets, ML-KEM-512, 768 and 1024. Generating a key, encapsulating and decapsulating look like this.

using System.Security.Cryptography;

if (!MLKem.IsSupported) return;

using MLKem recipient = MLKem.GenerateKey(MLKemAlgorithm.MLKem768);
byte[] publicKey = recipient.ExportEncapsulationKey();

using MLKem sender = MLKem.ImportEncapsulationKey(MLKemAlgorithm.MLKem768, publicKey);
sender.Encapsulate(out byte[] ciphertext, out byte[] sharedSecret);

byte[] sameSecret = recipient.Decapsulate(ciphertext);

Both sides now hold the same 32-byte secret. On Linux, .NET relies on OpenSSL 3.5 or later. On Windows, it relies on CNG, in recent Windows 11 releases. macOS, Android and the browser have no ML-KEM in .NET 10, so MLKem.IsSupported is the first thing to test.

The class also imports and exports keys in standard formats, SubjectPublicKeyInfo and PKCS#8, but those methods are still marked experimental (SYSLIB5006). The ML-DSA, SLH-DSA and composite ML-DSA signature classes are experimental as a whole.

What it leaves to you

ML-KEM gives a shared secret. Protecting a file or a message with it takes several more pieces, and each one carries a security decision.

  • The hybrid. .NET 10 has no hybrid key exchange. Combining ML-KEM with ECDH, as ANSSI requires for regulated systems, and deriving one key from both secrets is yours to write. A composite ML-KEM type has been approved for a later .NET release.
  • The format. Where the ciphertext goes, how the recipient is identified, how the content is encrypted and authenticated. CMS has a standard answer, KEMRecipientInfo (RFC 9629) and ML-KEM in CMS (RFC 9936), with the key derivation and key wrap they prescribe, in ASN.1 written by hand.
  • Large files. AesGcm in .NET encrypts a buffer in memory. A 10 GB archive needs a streaming construction.
  • The keys. Storing the private key under a password or in a vault, rotating it without losing old messages, backing it up.
  • The checks. Refusing a weak algorithm on input as on output, checking a key's consistency on import, testing against the official vectors.

None of these is out of reach for an experienced team. Together they add up to months of work, and to code someone must maintain and defend in an audit for as long as the data lives.

What a library adds

That is the job of Feranor PQC Suite on top of .NET 10. It uses MLKem and ECDiffieHellman as primitives and adds the IETF composite ML-KEM, CMS messages, encryption of streams of any size, a key store with rotation and backup, and the ANSSI profile.

CryptographyEngine engine = FeranorCryptographyDefaults.CreateEngine();   // ANSSI profile

using KemKeyPair bob = engine.GenerateKeyPair();                      // MLKEM1024-ECDH-P384-SHA3-256
byte[] message = engine.Encrypt(contract, KemRecipient.FromPublicKey(bob.PublicKey));
byte[] content = engine.Decrypt(message, bob.PrivateKey);

await engine.EncryptAsync(inputFile, outputFile, KemRecipient.FromPublicKey(bob.PublicKey));   // any size, streamed

The same message is read by the command line, by the sidecar for applications in Java, Python, Node or Go, and by the web console. It is standard CMS, so any conforming implementation reads it too.

The right choice depends on your team. With cryptographers ready to own those pieces for years, .NET 10 is a solid base. To protect data in production this quarter, a library spares you the construction.

.NET 10 gives you ML-KEM. Protecting a file with it is everything that comes after.

What Feranor PQC Suite adds around the primitives, and its price.

Post-quantum encryption with Feranor PQC Suite ➔