Skip to main content

A Pythonic implementation of the Diffie-Hellman key exchange protocol

Project description

diffiehellman

Travis CI PyPI version

% start synopsis

This is a Python-only version of the Diffie-Hellman key exchange library.

% end synopsis

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.6.tar.gz (8.9 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.6-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: moat_lib_diffiehellman-0.13.6.tar.gz
  • Upload date:
  • Size: 8.9 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.6.tar.gz
Algorithm Hash digest
SHA256 5b95efb97c918c88cbf19b9fafc4d4a59702aec206c69045231e40140f84b386
MD5 d4312f6b067fa601267efe5f965b9e68
BLAKE2b-256 7deccdee045f581134a650037e3fcd5981f344a020580e047db2f90ab3834d22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for moat_lib_diffiehellman-0.13.6-py3-none-any.whl
Algorithm Hash digest
SHA256 da5929fa8e54e54ce8c0981faa59dc8657a031997501c31b9571d07711671285
MD5 a24d7e0dfb5dd982600c1d6711ba4dcc
BLAKE2b-256 de9732cd87df69c28a5a45a63623e3372c14b50334197f82ac91bf4c7ded0c6e

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