https://github.com/bivex/ejafa_protocol
Multi-language (Python, PHP, Go) implementation of the Ejafa communication protocol, providing secure and efficient data exchange using modern cryptographic primitives.
https://github.com/bivex/ejafa_protocol
cryptography data-exchange go network-protocol php python security
Last synced: 6 days ago
JSON representation
Multi-language (Python, PHP, Go) implementation of the Ejafa communication protocol, providing secure and efficient data exchange using modern cryptographic primitives.
- Host: GitHub
- URL: https://github.com/bivex/ejafa_protocol
- Owner: bivex
- License: mit
- Created: 2025-05-16T19:58:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-13T22:43:37.000Z (11 months ago)
- Last Synced: 2025-07-14T00:28:34.634Z (11 months ago)
- Topics: cryptography, data-exchange, go, network-protocol, php, python, security
- Language: Python
- Size: 78.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EjafaProtocol Python Implementation
[](https://a.b-b.top)
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
## Installation
1. Clone this repository:
```
git clone https://github.com/yourusername/EjafaProtocol.git
cd EjafaProtocol
```
2. Install dependencies:
```
pip install -r requirements.txt
```
## Usage
Run the example implementation:
```
python ejafa.py
```
## Implementation Details
The EjafaProtocol Python implementation provides:
1. **Secure Key Exchange**: Using X25519 for Diffie-Hellman key exchange
2. **Key Derivation**: Using BLAKE2b for deriving session keys
3. **Authenticated Encryption**: Using XChaCha20-Poly1305 for secure message encryption
## API
```python
# 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)
```
## Security Notes
- This implementation uses cryptographic primitives from the `cryptography` and `PyNaCl` libraries
- The protocol uses 32-byte keys and 24-byte nonces for XChaCha20-Poly1305
- Key derivation uses 20 rounds of BLAKE2b hashing