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.5.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

moat_lib_diffiehellman-0.13.5-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file moat_lib_diffiehellman-0.13.5.tar.gz.

File metadata

  • Download URL: moat_lib_diffiehellman-0.13.5.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for moat_lib_diffiehellman-0.13.5.tar.gz
Algorithm Hash digest
SHA256 0b6b4a5e2d83f7dbcd7f0762905e30b004d2858ed7188ef4901e78f70a1e1134
MD5 46333ef20bff02e771f3626fd23cdf71
BLAKE2b-256 7c8509bd5da6a8f21d83fc6c78e121bd7c4e938492495251fbdc8bd35f11c298

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for moat_lib_diffiehellman-0.13.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b5d030682acb438bb0c5173c309fe4850a390a9a84c13560d16fde05f3897fb9
MD5 a3084fcc8ddc2b713417c40940372b03
BLAKE2b-256 9b76a332f1c69f96c2e0e6627b66b611004429099d6cb9c6b25851f5819d75eb

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