Post-quantum key, signature and ciphertext size calculator

Post-quantum cryptography (PQC) uses algorithms designed to resist attacks by both conventional and quantum computers. They run on ordinary hardware. A single ML-DSA-65 signature takes 3,309 bytes, or 4,412 characters in Base64.

Loading the tool…

Why use post-quantum cryptography now?

When a browser connects to a server, public-key cryptography helps them establish a secret and authenticate the server. Widely used schemes rely on the difficulty of factoring large integers (RSA) or solving discrete logarithms (Diffie-Hellman and elliptic-curve cryptography). A sufficiently powerful quantum computer running Shor’s algorithm could solve those problems efficiently. That could reveal a session key or let someone forge a software publisher’s signature. Post-quantum algorithms rely on problems for which no efficient quantum attack is known at the standardized parameter sizes.

Consider a medical record that must stay confidential for 30 years. Someone who records its encrypted transmission today can keep it and attempt to recover the session keys years later. This is the “harvest now, decrypt later” problem. Upgrading the connection protects future transfers. Copies of earlier traffic may already be in someone else’s hands. For a hospital, the starting point is the record’s confidentiality period. This timing problem is one reason NIST recommends preparing for the transition now.

What is the difference between ML-KEM, ML-DSA and SLH-DSA?

NIST standardized these three algorithms in 2024. Older papers use the names Kyber, Dilithium and SPHINCS+ for the designs that became ML-KEM, ML-DSA and SLH-DSA, respectively. For interoperability, check which version each library implements.

AlgorithmWhat it doesWhere it matters
ML-KEMUses lattice mathematics to let two parties establish a shared secret over a public channel.A secure connection can derive session keys from that secret and encrypt the actual traffic with a symmetric cipher such as AES. The protocol also needs to authenticate the peer.
ML-DSAUses lattice mathematics to sign data. Anyone with the trusted public key can verify the signature.A device can check that a firmware update came from its publisher and that the signed bytes arrived intact.
SLH-DSABuilds digital signatures from hash functions, offering a different mathematical basis for trust.A publisher can choose a hash-based signing scheme when larger signatures and the time needed to sign are acceptable.

For a device expected to last 15 years, the signature question matters at installation time. Can the device learn a new verification algorithm through a trusted update, or is the only verifier fixed in read-only memory? A fleet with a fixed verifier can take years to replace.

How much space does a post-quantum signature take?

These are the sizes of one detached signature. The signature has the same length for a one-line manifest and a large firmware image. For SLH-DSA, the small-signature (s) and fast-signing (f) variants have different storage costs. The SHA2 and SHAKE versions of the same variant have identical lengths.

SignatureRaw bytesBase64 characters, padded
ML-DSA-442,4203,228
ML-DSA-653,3094,412
ML-DSA-874,6276,172
SLH-DSA-SHA2-128s7,85610,476
SLH-DSA-SHA2-128f17,08822,784

Which ML-KEM values travel over the network?

In a basic exchange, one party supplies its public encapsulation key and the other returns a ciphertext. Both derive a 32-byte shared secret locally. To budget the two transmitted values, add the public key and ciphertext lengths. Count protocol framing and any additional key shares separately.

Parameter setPublic key (bytes)Ciphertext (bytes)Combined (raw bytes)
ML-KEM-5128007681,568
ML-KEM-7681,1841,0882,272
ML-KEM-10241,5681,5683,136

What can go wrong during a post-quantum migration?

A 4,096-byte binary field has room for an ML-DSA-65 signature. A 4,096-character text field falls 316 characters short once that signature is Base64-encoded. Limits can also apply to an entire certificate, signed token or update package. An end-to-end test should send the serialized object all the way through the gateway, database and receiving application.

Bandwidth and processing time are separate costs. Sending 10,000 detached ML-DSA-65 signatures adds 33.09 MB before packaging. The file transfer time calculator can translate that volume into time on a slow link. Signing time, verification time and peak memory depend on the implementation and device. An update that verifies quickly on a laptop can still exceed a controller’s memory budget.

Compatibility matters at both ends of a connection. A hybrid key exchange combines a traditional method and a post-quantum method within one protocol. Both peers must support the same combination, and the extra key material increases the handshake size. Test with the oldest supported client and the network equipment it actually uses. Check separately which signature algorithm authenticates the server.

How to use this tool

Check whether an object fits

  1. Choose the Algorithm and Parameter set named in your specification. For example, for an ML-KEM-768 public key, select ML-KEM, then ML-KEM-768.
  2. Under Object to measure, select the item your application stores or sends. For ML-KEM, Encapsulation ciphertext is the value returned to the other party. Shared secret is the value both parties derive locally. If you are sizing a private key export, check whether your library exports a seed or a full key.
  3. Match Storage format to the field. Raw binary counts bytes. Base64 (padded), Base64url (unpadded) and Hexadecimal count characters. For the signature segment of a compact signed JWT, use Base64url (unpadded).
  4. Enter Field capacity using digits only, such as 4096, or leave it empty to see sizes alone. If the limit applies to a whole token or file, first subtract the space used by headers, separators and other fields. Required space updates as you change the settings.

Read and compare the results

With the default ML-DSA-65 signature, a padded Base64 field needs 4,412 characters. A capacity of 4096 is 316 characters short. Switch to Raw binary and the same number now represents a byte limit: the signature takes 3,309 bytes, leaving 787 bytes free.

Open Compare ML-DSA parameter sets to check the other variants against the same object, format and capacity. To save the selected result, use the clipboard button beside Required space. It copies all four lengths and, if entered, the capacity check for the selected format. If clipboard access is unavailable, the summary appears selected for manual copying.

Your tool data stays in your browser

This tool processes your data on your device. The text, files, or passwords you enter and the results it creates are not sent to our servers or any other server.

Page and asset requests still occur. Production pages also load Google Tag Manager, Cloudflare Web Analytics, and AdSense advertising; tool code does not send inputs or results to analytics or ads. See our privacy policy.

To inspect requests while using the tool, open your browser's developer tools and select Network. Try it with sample data.

Read How to Check Website Network Requests in Chrome, Firefox, Edge and Safari.

Frequently asked questions about post-quantum cryptographic sizes

Many standardized post-quantum algorithms produce substantially larger cryptographic objects than traditional public-key algorithms. For example, an RSA-2048 signature occupies 256 bytes, while an Ed25519 signature occupies only 64 bytes. In comparison, an ML-DSA-44 signature requires 2,420 bytes, approximately 9.5 times the size of an RSA-2048 signature and nearly 38 times the size of an Ed25519 signature. Public key sizes also increase considerably: an Ed25519 public key occupies 32 bytes, compared to 1,312 bytes for ML-DSA-44. These differences arise from the mathematical structures used by the respective algorithms. However, larger cryptographic objects do not automatically indicate greater security, and these algorithms do not necessarily provide equivalent security guarantees. Use the post-quantum size calculator above to evaluate the storage and bandwidth implications of replacing existing cryptographic algorithms.

NIST defines five post-quantum security categories based on reference attacks against symmetric encryption and cryptographic hash functions. ML-KEM-512, ML-KEM-768 and ML-KEM-1024 correspond to security categories 1, 3 and 5, respectively. ML-DSA-44, ML-DSA-65 and ML-DSA-87 correspond to categories 2, 3 and 5. SLH-DSA provides parameter sets corresponding to categories 1, 3 and 5, with additional choices that prioritize smaller signatures or faster signing. Selecting a parameter set involves balancing security requirements, regulatory obligations, interoperability, storage capacity and computational performance. Higher security categories generally introduce additional resource requirements within the same algorithm family. Use this post-quantum cryptography calculator to compare the size implications of different parameter sets, but follow applicable security policies and protocol specifications rather than choosing an algorithm solely because it produces smaller keys or signatures.

Binary cryptographic objects often require text encoding when stored in JSON documents, database text fields, configuration files or web APIs. Standard padded Base64 encoding increases the original binary size by approximately 33.3%, with the exact character count calculated using the formula 4 × ceil(bytes / 3). Unpadded Base64url encoding uses ceil(4 × bytes / 3) characters and replaces characters that can be problematic in URLs. Hexadecimal encoding requires exactly two characters per byte, increasing the original size by 100%. For example, a 1,184-byte ML-KEM-768 public key requires 1,580 padded Base64 characters, 1,579 unpadded Base64url characters or 2,368 hexadecimal characters. The post-quantum size calculator automatically calculates these representations and checks whether the selected object fits within your specified field capacity. Additional formatting, metadata and container structures must be accounted for separately.

The size of an exported cryptographic key depends on both its underlying representation and its serialization format. For example, an expanded ML-DSA-65 private key occupies 4,032 bytes, but the original 32-byte key generation seed can also serve as a compact private key representation. Similarly, ML-KEM supports a 64-byte seed representation from which the expanded keys can be regenerated. NIST recognizes these seed-based representations as acceptable alternatives for private key storage. Formats such as PKCS#8, DER and PEM can introduce additional algorithm identifiers, structural metadata, encryption parameters, Base64 encoding and formatting characters. Consequently, the actual size of a private key file may be smaller or larger than the expanded key size specified in the cryptographic standard. When planning database storage, hardware security module capacity or key backups, verify the representation used by your cryptographic library. Both private key seeds and expanded private keys must be protected as sensitive credentials.

Post-quantum digital signatures can significantly increase the size of signed JSON Web Tokens (JWTs) and other authentication messages. RFC 9964 specifies the use of ML-DSA with JSON Object Signing and Encryption (JOSE) and CBOR Object Signing and Encryption (COSE). In the conventional compact JWT representation using JSON Web Signature (JWS), the signature is encoded as unpadded Base64url text. An ML-DSA-44 signature requires 3,227 characters, while ML-DSA-65 requires 4,412 characters and ML-DSA-87 requires 6,170 characters, before including the token’s header, payload and separators. This can exceed common browser cookie capacity limits or configured HTTP header size limits in web servers, reverse proxies, load balancers and API gateways. Use the Base64url storage format and field capacity options in this calculator to estimate the signature’s contribution to the total token size. Verify support across your authentication infrastructure and consider opaque session identifiers or binary token formats where appropriate. Never truncate a cryptographic signature to make it fit within an existing storage limit.

NIST publishes the parameter sets for ML-KEM key establishment (FIPS 203), ML-DSA signatures (FIPS 204) and SLH-DSA signatures (FIPS 205). RFC 4648 defines the Base64, URL-safe Base64 and hexadecimal encodings.

Premium is coming soon

An optional premium subscription to remove ads is planned. Subscriptions are not available yet.

You can keep using our free tools without an account.