OpenSSL Studio / S/MIME & CMS Workshop
What you will do: Sign, verify, encrypt and decrypt CMS messages with real OpenSSL 3.6 running in the browser, using ML-DSA, SLH-DSA and ML-KEM-768.
Worked example: An ML-DSA-65 CMS SignedData signed and verified end to end, then an ML-KEM-768 AuthEnvelopedData encrypted and decrypted; toggle the signing key through the PKCS#11 provider.
Runtime and privacy: The cryptographic exercise runs in this browser. Review the site privacy terms before entering sensitive material; use synthetic inputs for learning and evaluation.
Browse all Crypto Lab tools · Learn with Email & Document Signing
For your role
- Developer / Engineer
- Run Sign + Verify with ML-DSA-65 on a payload, then Encrypt + Decrypt with ML-KEM-768 and aes-256-gcm: the CMS SignedData and AuthEnvelopedData are produced by OpenSSL 3.6 WASM, and Use HSM key routes the signing key through softhsmv3.
- Security Architect
- The Dual-sign + Verify step (ML-DSA-65 with EC, marked WIP and not LAMPS composite) shows the migration-period pattern of two SignerInfos; the CMS Encryption step shows KEMRecipientInfo replacing key transport.
- Researcher / Academic
- Run the ML-DSA and ML-KEM steps and compare the CMS structures with and without the HSM key; the Live HSM Provider smoke test at the top shows whether the PKCS#11 provider initialised.
Live HSM Provider — bundle smoke test
This panel checks whether the bundled CMS worker and PKCS#11 provider initialize. Registration alone does not establish that a particular key-generation, signing, verification, encryption or decryption operation succeeded. The separate sample controls below report their own executed operations and results.
What initialization checks
The worker reports the outcome of its provider-initialization request. Use each sample operation's output to inspect what that operation actually executed; initialization is not a substitute for an operation result. Evaluate provider setup and supported mechanisms for the exact version and configuration used by your own tools.
Source: pkcs11-provider vendored at pqctoday-hsm/src/vendor/pkcs11-provider/.
Worked ML-DSA-65 HSM recipe
When the signing sample below is available (it needs the provider check above to finish without an error), select ML-DSA-65, keep Use HSM key selected, enter a fictional payload, then choose Sign + Verify. These are the provider-routed commands after token and key preparation, for the bundled OpenSSL 3.6.3 and pkcs11-provider 1.1 sample. This named recipe stays ML-DSA-65 if you select a different algorithm below.
The sample first initializes its own token and creates the alice key through PKCS#11 C_GenerateKeyPair. The commands below use workspace filenames. To copy them into a separately prepared workspace, create its own ML-DSA-65 token key named alice and supply the entered UTF-8 payload as payload-alice.bin. Another worker or a native terminal needs its own setup and key; matching labels do not share token objects. genpkey -out pkcs11:… is not this preparation: that output path writes a file rather than creating the required token object.
In a session where pkcs11-provider is already registered, as in this sample and in OpenSSL Studio, the URI selects the sample key through that builtin provider; no ENGINE option or native module path is needed there. A native terminal must have the provider registered and configured first. 1234 is this fictional sample's public PIN, not a production credential-handling example.
Issue the sample certificate
openssl req -new -x509 -key 'pkcs11:object=alice;type=private?pin-value=1234' -out alice.crt -subj '/CN=Alice/O=PQC Workshop/C=US' -days 365Sign the entered payload
openssl cms -sign -signer alice.crt -inkey 'pkcs11:object=alice;type=private?pin-value=1234' -in payload-alice.bin -binary -nodetach -outform DER -out signed-alice.p7m -md sha256Verify and recover the payload
openssl cms -verify -in signed-alice.p7m -inform DER -certfile alice.crt -CAfile alice.crt -binary -out out-alice.binThe copied commands use the explicit private-key URI returned by OpenSSL Studio. The CMS lesson retains its existing compatibility spelling, pkcs11:object=alice;pin-value=1234, inside its separate worker. Both select that worker's own prepared sample key; this is not a transfer of token objects between workers.
These workspace files are separate from the signing sample's internal /ssl/ files. The sample runs the same certificate/signing operations with those internal paths, then copies its returned signed DER to /ssl/in-alice.p7m for verification. The copyable sequence instead verifies its own preceding signed-alice.p7m directly. -binary preserves payload bytes; -nodetach embeds them. The local self-signed certificate is the sample trust anchor. Inspect the certificate and downloaded CMS, and compare the recovered bytes with the input; initialization alone is not that result.
With your production tools, evaluate provider and key selection, token key generation, actual artifact verification and failure reporting. Retain the configuration, public artifacts and input-byte comparison. A successful browser software-token sample does not establish physical-HSM protection, deployed trust or every mechanism's support.
Production Tool Capabilities & Verification Requirements
What this sample check establishes: Executes real OpenSSL 3.6 WASM CMS (RFC 5652; RFC 9882 and RFC 9814 for SignedData; RFC 9629 / RFC 9936 for `KEMRecipientInfo`) `SignedData` (`ML-DSA`, `SLH-DSA`) and `AuthEnvelopedData` (`ML-KEM-768`) operations.
Browser sandbox limitation (non-certification boundary): Operates on sample payloads in browser WASM; it does not test enterprise email gateway (SEG) MIME parsing, Outlook/Thunderbird client plugins, or corporate LDAP key directories.
What to require and test in your production tools:
- S/MIME 4.0 and CMS implementation supporting RFC 9629 `KEMRecipientInfo` (`id-ori-kem`, 1.2.840.113549.1.9.16.13.3) with `ML-KEM-768/1024` (RFC 9936) and `ML-DSA` (RFC 9882; RFC 9881 for certificates).
- Secure Email Gateway (SEG) content-inspection compatibility with post-quantum S/MIME envelopes.
- Enterprise KMS/HSM key escrow and recovery for employee `ML-KEM` decapsulation keys so encrypted mail remains recoverable after device loss.
Try it
- 1. Predict before you run it.
- 2. Run or change the tool above.
- 3. Explain what the result shows.
Run Encrypt + Decrypt with ML-KEM-768. Which CMS structure carries the recipient key material?
Next step
Turn it into a plan: MTI NegotiatorThis tool practises the Email & Document Signing module, phase 5 (Pilots & Migration); MTI Negotiator produces a deliverable of that phase.
Related content
Next in OpenSSL Studio