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

Uploaded Source

Built Distribution

moat_lib_diffiehellman-0.13.4-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for moat_lib_diffiehellman-0.13.4.tar.gz
Algorithm Hash digest
SHA256 7f1787d0cd477387d48b283a650c4b4413c8297257af610003c892a1bf9c2425
MD5 b867c88b691fdbb8b3063f910cd92fae
BLAKE2b-256 0869f67c3bcadaf316bd0d70c2b1611d259d8f79092de5fc083692b7db9f8aac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for moat_lib_diffiehellman-0.13.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2b9fccb7874ba9037cf9d593edfa3506d7844405850527b1d7008c63a7c62916
MD5 96fe890f9504887728eb7bafe54c3af9
BLAKE2b-256 a5a7e46c3c3afaf95d09da0a46262d019695fca7e1c8668ccc6ff82f803bb61c

See more details on using hashes here.

Supported by

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