https://github.com/halukyamaner/ecdh-key-exchanger
ECDH Key Exchanger
https://github.com/halukyamaner/ecdh-key-exchanger
chacha20 chacha20-poly1305 chacha20poly1305 diffie-hellman diffie-hellman-algorithm ecc ecdh elliptic elliptic-curve elliptic-curve-cryptography elliptic-curve-diffie-hellman elliptic-curves secp521r1
Last synced: 3 months ago
JSON representation
ECDH Key Exchanger
- Host: GitHub
- URL: https://github.com/halukyamaner/ecdh-key-exchanger
- Owner: halukyamaner
- Created: 2024-09-04T21:09:00.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-09-04T21:09:57.000Z (10 months ago)
- Last Synced: 2025-01-18T02:27:59.624Z (5 months ago)
- Topics: chacha20, chacha20-poly1305, chacha20poly1305, diffie-hellman, diffie-hellman-algorithm, ecc, ecdh, elliptic, elliptic-curve, elliptic-curve-cryptography, elliptic-curve-diffie-hellman, elliptic-curves, secp521r1
- Language: Python
- Homepage: https://www.halukyamaner.com
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ECDH Key Exchanger
## Overview
ECDH Key Exchanger is a Python library that implements the Elliptic Curve Diffie-Hellman (ECDH) cryptographic protocol for secure key exchange, combined with ChaCha20Poly1305 for message encryption and decryption. It ensures secure communication by generating a shared secret between two parties without transmitting the secret over the network.## Features
- **Secure Key Exchange**: Utilizes the SECP521R1 elliptic curve for robust ECDH key exchanges.
- **Encryption and Decryption**: Employs ChaCha20Poly1305 AEAD for encrypting and decrypting messages, ensuring data integrity and confidentiality.
- **Performance Logging**: Measures and logs the duration of cryptographic operations, which helps in performance tuning and debugging.
- **Detailed Debugging Output**: Logs all cryptographic operations in detail, both to console and to a dedicated log file (`ecdhtest.log`), aiding in troubleshooting and educational purposes.
- **Error Handling**: Gracefully handles errors, including improper decryption attempts, with comprehensive logging for each scenario.## Requirements
- Python 3.x
- Cryptography library version 2.8 or higher## Usage
To use the ECDH Key Exchanger library, you need to initialize an instance of the `SecureECDH` class and call the `ecdh_process` method to perform the key exchange and message encryption/decryption. Here is a quick example:```python
from ecdh_key_exchanger import SecureECDH# Initialize the SecureECDH object
ecdh = SecureECDH()# Perform the ECDH process
ecdh.ecdh_process()# Results and logs can be viewed in the console and in ecdhtest.log