Skip to main content

A Pythonic implementation of the Diffie-Hellman key exchange protocol

Project description

diffiehellman

Travis CI PyPI version

The Python Diffie-Hellman key exchange library.

Usage

from diffiehellman.diffiehellman import DiffieHellman

alice = DiffieHellman()
bob = DiffieHellman()

alice.generate_public_key()    # automatically generates private key
bob.generate_public_key()

alice.generate_shared_secret(bob.public_key, echo_return_key=True)
bob.generate_shared_secret(alice.public_key, echo_return_key=True)

Install

pip install diffiehellman

Features

  • Implements Diffie-Hellman key exchange
  • Pretty fast
  • Adjustable key size
  • Includes primes for groups 5 and 14-18
  • Currently works only with Python 3 (requires ssl). An OpenSSL compatible version is in the works.

Code of Misconduct

By using this package, you pledge to use it for good, not for evil. In particular, you pledge never to use this code to limit the human mind or its natural rights, in particular freedom of expression.

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

moat-lib-diffiehellman-0.13.1.3.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file moat-lib-diffiehellman-0.13.1.3.tar.gz.

File metadata

  • Download URL: moat-lib-diffiehellman-0.13.1.3.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/63.2.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.10.5

File hashes

Hashes for moat-lib-diffiehellman-0.13.1.3.tar.gz
Algorithm Hash digest
SHA256 5839552e20af1bad4e5b3b43a0c419ec621fd4984da19a855354e2229e5f81cf
MD5 7a21dd9e9746c698680450eae6a1713a
BLAKE2b-256 a3e3efac44422778c19c944c6cc7205cdf5469301911c4513200091c84886663

See more details on using hashes here.

File details

Details for the file moat_lib_diffiehellman-0.13.1.3-py3-none-any.whl.

File metadata

  • Download URL: moat_lib_diffiehellman-0.13.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/63.2.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.10.5

File hashes

Hashes for moat_lib_diffiehellman-0.13.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 534b030d4d0ad9d092f18821f7ae3dabb88b9a766c64854d2aa6a0066b90d043
MD5 2f30801c8841e676088998b113ec1cf8
BLAKE2b-256 2d63109a2385e9ff7708fd5aa5822d34df6f2b91b79b9bbcd88c68299a4614f2

See more details on using hashes here.

Supported by

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