{"id":24639,"library":"spsdk-pqc","title":"SPSDK PQC - Post-Quantum Crypto support for SPSDK","description":"A plugin for NXP's SPSDK that provides post-quantum cryptography support, including key generation, signing, and verification using algorithms like Dilithium, Falcon, and SPHINCS+. Current version 0.6.8, requires Python >=3.9. Released as part of SPSDK Plugins, with new versions approximately every 2-3 months.","status":"active","version":"0.6.8","language":"python","source_language":"en","source_url":"https://github.com/nxp-mcuxpresso/spsdk_plugins/tree/master/pqc","tags":["pqc","post-quantum","cryptography","nxp","spsdk","plugin"],"install":[{"cmd":"pip install spsdk-pqc","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Core SPSDK framework required for all operations","package":"spsdk","optional":false},{"reason":"C library for post-quantum algorithms, wrapped by spsdk-pqc","package":"liboqs","optional":true}],"imports":[{"note":"Old import path before SPSDK Plugins restructure","wrong":"from spsdk.pqc import PQCProvider","symbol":"PQCProvider","correct":"from spsdk_pqc import PQCProvider"},{"note":"Old import path before SPSDK Plugins restructure","wrong":"from spsdk.pqc import PQCSignature","symbol":"PQCSignature","correct":"from spsdk_pqc import PQCSignature"}],"quickstart":{"code":"from spsdk_pqc import PQCProvider\nfrom spsdk import SpsdkError\n\nprovider = PQCProvider()\n# Generate a Dilithium2 key pair\nprivate_key, public_key = provider.generate_keypair('Dilithium2')\nprint('Public key:', public_key.hex())\n# Sign a message\nmessage = b'Test message'\nsignature = provider.sign(private_key, message)\nprint('Signature:', signature.hex())\n# Verify\nis_valid = provider.verify(public_key, message, signature)\nprint('Verification:', is_valid)","lang":"python","description":"Initialize PQCProvider, generate a Dilithium2 key pair, sign a message, and verify the signature."},"warnings":[{"fix":"Install liboqs system-wide (e.g., apt install liboqs-dev) or use a precompiled wheel that bundles it.","message":"The library wraps liboqs, which must be installed separately or the Python package may fail at runtime with 'OQS library not found'.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Change 'from spsdk.pqc import ...' to 'from spsdk_pqc import ...'","message":"In SPSDK Plugins 3.0.0, the import path changed from spsdk.pqc to spsdk_pqc. Old imports will break.","severity":"breaking","affected_versions":"<=0.5.3 -> >=0.6.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from spsdk_pqc import PQCProvider' instead.","cause":"Old import path used; module was renamed to spsdk_pqc in version 0.6.0.","error":"ModuleNotFoundError: No module named 'spsdk.pqc'"},{"fix":"Install liboqs: e.g., 'apt install liboqs-dev' or download from https://github.com/open-quantum-safe/liboqs.","cause":"liboqs C library is not installed on the system.","error":"OSError: liboqs.so: cannot open shared object file: No such file or directory"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}