Skip to main content

Python wrapper around implementation of the Streamlined NTRU Prime cryptosystems

Project description

Python wrapper around implementation of the Streamlined NTRU Prime cryptosystem.

To access the Python functions provided by ntruprime, import the library (for, e.g., sntrup1277):

from ntruprime import sntrup1277

To generate a key pair:

pk,sk = sntrup1277.keypair()

To generate a ciphertext c encapsulating a randomly generated session key k:

c,k = sntrup1277.enc(pk)

To recover a session key from a ciphertext:

k = sntrup1277.dec(c,sk)

As a larger example, the following test script creates a key pair, creates a ciphertext and session key, and then recovers the session key from the ciphertext:

import ntruprime
kem = ntruprime.sntrup1277
pk,sk = kem.keypair()
c,k = kem.enc(pk)
assert k == kem.dec(c,sk)

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

ntruprime-20241021.4.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

ntruprime-20241021.4-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file ntruprime-20241021.4.tar.gz.

File metadata

  • Download URL: ntruprime-20241021.4.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for ntruprime-20241021.4.tar.gz
Algorithm Hash digest
SHA256 ac03fe506f4c752fa7436a9fa6b05c555864313aaf60dff5b7ce9d642ed504be
MD5 3280a4982398cff4906415df13d62e6e
BLAKE2b-256 f8ab9de370fa8494b74767d6f9074445bf06d577716ffaa36be173103353919e

See more details on using hashes here.

File details

Details for the file ntruprime-20241021.4-py3-none-any.whl.

File metadata

  • Download URL: ntruprime-20241021.4-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for ntruprime-20241021.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c933a43727c834ae3af5c3b5ee34f6949da474e109b51f6468337c3096c093ca
MD5 ff454e82a6051dc3168c9eac627ff6fb
BLAKE2b-256 101249366ac8a739464dc3a398c4d4278a7f4dae53e78e019a632fe5738444f3

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