Installation¶
Requirements¶
- Python 3.8 or higher
- pip (Python package manager)
Note: qcrypto relies on the Open Quantum Safe liboqs native library. On some platforms, the liboqs shared library must be installed separately.
Install from PyPI¶
This installs the Python dependencies:
liboqs-python(Python bindings for Open Quantum Safe)cryptography(AES-GCM encryption and key derivation)
Verify Installation¶
Or test the CLI:
Install from Source¶
Platform Notes¶
macOS¶
Usually works out of the box on Apple Silicon and Intel Macs.
If you encounter errors related to liboqs, install it with Homebrew:
Linux¶
On Linux, qcrypto installs the Python bindings (liboqs-python), but the liboqs shared library (liboqs.so) may need to be installed separately.
If you see an error like:
Build and install liboqs from source:
sudo apt update
sudo apt install -y git cmake ninja-build build-essential libssl-dev
git clone https://github.com/open-quantum-safe/liboqs
cd liboqs
git fetch --tags
git checkout 0.14.0
cmake -S . -B build -GNinja \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=$HOME/.local
cmake --build build
cmake --install build
Ensure the shared library can be found at runtime:
To make this permanent:
Windows¶
Not officially supported at this time.
If you want to experiment with qcrypto on Windows, use WSL2 (Windows Subsystem for Linux).
Available Algorithms¶
The available algorithms depend on your liboqs build.
To list supported algorithms:
import oqs
print("KEMs:", oqs.get_enabled_KEM_mechanisms())
print("Signatures:", oqs.get_enabled_sig_mechanisms())
Or via the command line:
Troubleshooting¶
ModuleNotFoundError: No module named 'oqs'¶
The Python bindings were not installed correctly. Try:
RuntimeError: No oqs shared libraries found¶
The liboqs shared library is missing or not discoverable by the dynamic linker. Install liboqs and ensure it is on your library path (LD_LIBRARY_PATH on Linux).
Algorithm not available¶
Your liboqs build may not include all algorithms. The standard liboqs release includes all NIST-selected algorithms.
Permission errors on key files¶
The CLI creates key material with restricted permissions (0600). Ensure you have write access to: