Skip to content

Instantly share code, notes, and snippets.

View firdan-machda's full-sized avatar

Firdan Machda firdan-machda

View GitHub Profile
@firdan-machda
firdan-machda / ecdh_eke.py
Created November 14, 2024 08:24 — forked from byt3bl33d3r/ecdh_eke.py
ECDH Encrypted Key Exchange (Python 3.6+)
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, padding
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from secrets import token_bytes
class DiffieHellman:
def __init__(self):