This is a Python implementation of the EjafaProtocol, a secure communication protocol that uses:
- X25519 for key exchange
- BLAKE2b for key derivation
- XChaCha20-Poly1305 for authenticated encryption
- Clone this repository:
git clone https://github.com/yourusername/EjafaProtocol.git
cd EjafaProtocol
- Install dependencies:
pip install -r requirements.txt
Run the example implementation:
python ejafa.py
The EjafaProtocol Python implementation provides:
- Secure Key Exchange: Using X25519 for Diffie-Hellman key exchange
- Key Derivation: Using BLAKE2b for deriving session keys
- Authenticated Encryption: Using XChaCha20-Poly1305 for secure message encryption
# Create protocol instances
alice = EjafaProtocol("Alice", alice_private_key, alice_public_key)
bob = EjafaProtocol("Bob", bob_private_key, bob_public_key)
# Perform key exchange
shared_secret = alice.perform_key_exchange(bob_public_key)
# Derive session key
key = alice.derive_key(shared_secret)
# Encrypt message
ciphertext, nonce = alice.encrypt(plaintext, key)
# Decrypt message
plaintext = bob.decrypt(ciphertext, key, nonce)- This implementation uses cryptographic primitives from the
cryptographyandPyNaCllibraries - The protocol uses 32-byte keys and 24-byte nonces for XChaCha20-Poly1305
- Key derivation uses 20 rounds of BLAKE2b hashing