Barvna shema: Svetla
Trenutno dejavna stran: start » en » Documentation » Post-Quantum Cryptography » WKL.System.Security.Cryptography overview » Troubleshooting » The policy refuses an operation

The policy refuses an operation

An operation throws a CryptographicException that names BSI TR-02102-1, for example:

CryptoMode.PostQuantum uses a post-quantum method without a classical one, which BSI TR-02102-1 (2026-01), §2.4 and §5.3.4 does not recommend. Use CryptoMode.Hybrid, or permit it at startup with PostQuantumConfig.Exemptions |= PostQuantumExemptions.PurePostQuantum.
ML-KEM-512 is not recommended by BSI TR-02102-1 (2026-01), §2.4.3, Table 2.7; use ML-KEM-768 or ML-KEM-1024. To create data with it anyway, permit it at startup with PostQuantumConfig.Exemptions |= PostQuantumExemptions.ReducedParameterSets. Verifying and decapsulating existing data needs no exemption.

Environment

All targets. Operations that use PQ algorithms that BSI TR-02102-1 (2026-01) doesn't recommend are affected.

Cause

The library enforces the recommendations of BSI TR-02102-1 by default. New data with ML-DSA-44, ML-KEM-512, composite ML-KEM, or the library's first combiner is created only with an exemption. PostQuantum mode needs an exemption for every operation, including verification. The message names the guideline section, the recommended alternative, and the flag.

Resolution

Depending on your app, choose one of these approaches:

  • Use a recommended algorithm. Replace ML-DSA-44 with ML-DSA-65 or ML-DSA-87, and ML-KEM-512 with ML-KEM-768 or ML-KEM-1024. Use CryptoMode.Hybrid instead of CryptoMode.PostQuantum.
  • Allow the deviation explicitly if a standard or a peer requires the algorithm. Set the flag from the message once when your app starts:

    PostQuantumConfig.Exemptions |= PostQuantumExemptions.ReducedParameterSets;

    Every use then raises the PostQuantumConfig.PolicyDeviation event, which you can log.

For which algorithms need which flag, see Post-quantum algorithm policy.

en/wiki/pqcrypt/lib/troubleshooting/policy-refuses-operation.txt · Zadnja sprememba: uporabnika Wolfgang van der Stille