Skip to main content

Research code for NTRU-style encryption over finite group algebra.

Project description

GR-NTRU

Research code for an NTRU-style encryption experiment over finite group algebra. Classical NTRU uses

Z[x]/(x^N - 1) ~= Z[C_N].

This package replaces the cyclic group C_N with a finite group G and works in Z[G], with reductions modulo p and q. For noncommutative groups it fixes a left-sided convention:

h = f^{-1} g mod q
e = p h r + m mod q
f e = p g r + f m mod q

After center lifting, multiplying by f^{-1} modulo p recovers m when coefficients have not wrapped modulo q.

Status

This is research software, not production cryptography. The package is now pure Python and does not depend on SageMath. It includes direct finite-group arithmetic for cyclic, dihedral, and symmetric groups.

Optional FFT acceleration is used when compatible packages are installed:

  • fft-dihedral>=0.2.0 accelerates dihedral multiplication and inversion over compatible prime fields.
  • fft-symmetric>=0.2.0 accelerates symmetric-group multiplication and inversion over prime fields with characteristic p > n.

Composite NTRU-style moduli such as q = 2048 still use the pure-Python fallback path.

For dihedral groups, the fallback path also includes a faster inverse routine: when FFTs are unavailable over a small prime field such as F_3, inversion is reduced to a cyclic-polynomial inverse instead of a dense 2n x 2n linear solve.

Install

From PyPI:

python -m pip install gr-ntru

From a checkout:

python -m pip install -e .

With optional FFT backends:

python -m pip install -e ".[fft]"

Run Experiments

From a checkout:

python run_gr_ntru.py
python run_gr_ntru.py --profile larger --seed 20260506 --skip-cyclic-check
python run_gr_ntru.py --profile fft --seed 20260506 --skip-cyclic-check

After editable install:

gr-ntru --profile larger --seed 20260506 --skip-cyclic-check
python -m gr_ntru.cli --group symmetric --n 5 --p 7 --q 4099 --d 15 --trials 5

Test

PYTHONPATH=src python -m unittest discover -s tests

Near-Term Research Directions

  • Separate parameter sets from experiment dictionaries.
  • Extend acceleration to Z/2^k Z or add Hensel lifting for NTRU-like q.
  • Decide whether a Rust crate should own fast arithmetic kernels while Python remains the research interface.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gr_ntru-0.1.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gr_ntru-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file gr_ntru-0.1.0.tar.gz.

File metadata

  • Download URL: gr_ntru-0.1.0.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for gr_ntru-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8db181c1c5a58867ed6ffe4e7638f7ab63572a03ee50822e6a5788988b68d7b5
MD5 a94b4b50d68ec05871af4a0f9ff9d4cb
BLAKE2b-256 bb95fda9a953461a70a7450332711281bc244c96e41d9ea78d8cf8842dff878f

See more details on using hashes here.

File details

Details for the file gr_ntru-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gr_ntru-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for gr_ntru-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32738dd16056c59fbbcfcceac2770a3b2787d842b1bacb2cb6b9f9a6c235b20d
MD5 c1fc49b55d9d599d5f78cdd13aa2bbc2
BLAKE2b-256 427a3ebc05ce3e05b209552b45b85eb9ef2ce7f367dab9d2fcd8880bb8104609

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page