Skip to main content

A Pythonic implementation of the Diffie-Hellman key exchange protocol

Project description

Diffie-Hellman key exchange

% start synopsis % start main

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

% end synopsis

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.

% end main

Usage

from moat.lib.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)

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: moat_lib_diffiehellman-0.13.7.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for moat_lib_diffiehellman-0.13.7.tar.gz
Algorithm Hash digest
SHA256 35f4bf3ec86d54aea5b4feac18c4d776630d904276a9c36032050d67ee0f347f
MD5 23db9bb89b8dd6c6e77714c4b1f67ee8
BLAKE2b-256 821243ed269df3e4d4f87d0fb8a52bb5c8a4b994189db146297494b150725047

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for moat_lib_diffiehellman-0.13.7-py3-none-any.whl
Algorithm Hash digest
SHA256 22ef2bbe697bb9b6429f3da5477177ea72338dc4288b18e706697295c63539c6
MD5 15e07f2863ce8ea809eb45969e4a0b33
BLAKE2b-256 2c4f5e7106af5527731b76b9061408d0bb6ed7904219198b74ac9da3e6a2e8bc

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