Skip to main content

Pure Python Implementation of Diffie-Hellman Key Exchange

Project description

Python package

pyDH

Pure Python Implementation of Diffie-Hellman Key Exchange. Py2, Py3, PyPy compatible.

Example

To use as a library:

import pyDH
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
d1_sharedkey == d2_sharedkey

By default it uses the group 14 (2048 bit). To use another group (e.g., 15):

d1 = pyDH.DiffieHellman(15) #or pyDH.DiffieHellman(group=15)

Installation

To install pyDH, simply:

$ pip install pyDH

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

pyDH-0.1.6.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

pyDH-0.1.6-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file pyDH-0.1.6.tar.gz.

File metadata

  • Download URL: pyDH-0.1.6.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for pyDH-0.1.6.tar.gz
Algorithm Hash digest
SHA256 748ba74bc5e60066c05ef0047f71e8c4ab88e44c20622bdbfa9ab73a7f9e47d3
MD5 85cf8c9325e32c7e0bec6e9b7085c9b4
BLAKE2b-256 fe2410c3d959bf093592e11badb32850fc1271ea01d018ebe1067e507182b097

See more details on using hashes here.

File details

Details for the file pyDH-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pyDH-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for pyDH-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 45ef1010a93555a0ffd2979841bc4d0d411c9f5b09418d1ae84ee27f255ec1e2
MD5 f4b52358c024050b91789d9f75921f44
BLAKE2b-256 3a3bff8929cce916915378c5f0db73d9fb62aa54bdd4ea8add7b9ad024f092f6

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