fpylll
A Python interface for https://github.com/fplll/fplll
What it is and what it does
fpylll exposes the fplll lattice reduction library to Python, allowing developers to work with integer matrices and apply reduction algorithms central to computational number theory and cryptanalysis. It provides classes like IntegerMatrix for matrix construction, GSO for Gram-Schmidt orthogonalization, and LLL/BKZ for lattice basis reduction—the core operations needed to solve lattice problems such as finding short vectors or breaking certain cryptographic schemes.
The package is a thin Cython wrapper around C/C++ code, so it depends on external libraries (GMP, MPFR, fplll) being compiled and linked at install time. Pre-built wheels exist for common platforms, but installation can require manual compilation on less common architectures. Once installed, it integrates into the Sage computer algebra system and is available via PyPI and Conda-Forge.
Use it for:
- Implementing lattice-based cryptanalysis or testing the security of lattice cryptographic schemes.
- Computing shortest vectors in lattices or solving the shortest vector problem for research.
- Reducing integer matrix bases for number-theoretic computations in academic or research settings.
- Prototyping BKZ and LLL algorithms for lattice geometry or optimization research.
- Integrating lattice reduction into larger computational workflows within Sage or standalone Python.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
fpylll is a Python wrapper for the fplll lattice reduction library, providing access to algorithms like LLL and BKZ for reducing integer matrices and computing Gram-Schmidt orthogonalization.
Yes, if you need lattice reduction algorithms and can satisfy the C/C++ build dependencies. The package is actively maintained, has no known vulnerabilities, and pre-built wheels reduce friction on common platforms. However, the GPL version 2 or later license requires verification against your project's licensing constraints, and the unclear license treatment in metadata warrants explicit confirmation before use in proprietary or restricted-license contexts.
Install
fpylll on PyPI
pip
pip install fpyllluv
uv add fpylllpoetry
poetry add fpylllInstalling fpylll
Before you install
Medium install friction due to compiled C/C++ dependencies. Requires GMP or MPIR, MPFR, and the fplll library to be built and linked; pre-built wheels are available for common platforms, but manual compilation may be needed on unsupported architectures.
License in practice
Licensed under GNU General Public License, version 2 or later; license treatment is marked unclear in the metadata. Users should verify GPL compatibility with their project before integrating fpylll.
Quickstart
pip install fpylll
from fpylll import IntegerMatrix, GSO, LLL
A = IntegerMatrix(50, 50)
A.randomize("ntrulike", bits=50, q=127)
M = GSO.Mat(A)
M.update_gso()
L = LLL.Reduction(M)
L()
Requires GMP/MPIR, MPFR, and fplll C/C++ libraries to be installed and linked; LD_LIBRARY_PATH may need to be set at runtime to locate shared libraries.
Verify before relying
- Whether pre-built wheels include all optional features (e.g., QD double-double/quad-double arithmetic support).
- Exact Python version support range (requires_python is unspecified in metadata).
- Performance characteristics and scalability limits for large matrices or high-dimensional lattices.
- Whether multicore support mentioned in the description is fully functional and documented.
Package facts
| License | GNU General Public License, version 2 or later (unclear) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 442 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 102,671/month — #12,856 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fpylll-0.6.4-cp310-cp310-macosx_10_9_x86_64.whl; fpylll-0.6.4-cp310-cp310-macosx_11_0_arm64.whl; fpylll-0.6.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; fpylll-0.6.4-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl; fpylll-0.6.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fpylll-0.6.4-cp310-cp310-musllinux_1_2_aarch64.whl; fpylll-0.6.4-cp310-cp310-musllinux_1_2_i686.whl; fpylll-0.6.4-cp310-cp310-musllinux_1_2_x86_64.whl; fpylll-0.6.4-cp311-cp311-macosx_10_9_x86_64.whl; fpylll-0.6.4-cp311-cp311-macosx_11_0_arm64.whl; fpylll-0.6.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; fpylll-0.6.4-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl; fpylll-0.6.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fpylll-0.6.4-cp311-cp311-musllinux_1_2_aarch64.whl; fpylll-0.6.4-cp311-cp311-musllinux_1_2_i686.whl; fpylll-0.6.4-cp311-cp311-musllinux_1_2_x86_64.whl; fpylll-0.6.4-cp312-cp312-macosx_10_13_x86_64.whl; fpylll-0.6.4-cp312-cp312-macosx_11_0_arm64.whl; fpylll-0.6.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; fpylll-0.6.4-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
cypari2cypari2 provides a Python interface to PARI/GP,…
copyleft · top 15,000 on PyPI
cylpCyLP provides a Python interface to COIN-OR's…
copyleft · top 15,000 on PyPI
onemkl-sycl-blasProvides optimized C and Data Parallel C++…
unclear · top 15,000 on PyPI
mklIntel oneAPI Math Kernel Library provides…
unclear · top 15,000 on PyPI
onemkl-sycl-lapackProvides optimized C and Data Parallel C++…
unclear · top 15,000 on PyPI
linear-operatorLinearOperator abstracts structured matrix…
permissive · top 5,000 on PyPI
onemkl-sycl-sparseProvides C and Data Parallel C++ (DPC++)…
unclear · top 15,000 on PyPI