# Matryoshka Protocol (MATP)
Invisible secure messaging with steganography, post-quantum cryptography, and zero-knowledge proofs.
## 📦 Features
- **Invisible messaging** - Hide encrypted messages in normal web traffic
- **Post-quantum cryptography** - Kyber-512 KEM and Dilithium-2 signatures
- **Group messaging** - Fractal Group Ratchet for efficient group encryption
- **Zero-knowledge proofs** - Sigma protocol for plausible deniability
- **Multiple steganography modes** - JSON API, EXIF, Fast Ghost
- **Classical crypto fallback** - X25519, Ed25519, AES-256-GCM
## 📦 Installation
```bash
pip install matp
```
## 🚀 Quick Start
### 1. Basic 1-to-1 Messaging
```python
from matp import MatryoshkaProtocol
# Initialize
alice = MatryoshkaProtocol()
bob = MatryoshkaProtocol()
# Key exchange (X25519)
alice_priv, alice_pub = MatryoshkaProtocol.generate_keypair()
bob_priv, bob_pub = MatryoshkaProtocol.generate_keypair()
shared_secret = MatryoshkaProtocol.derive_shared_secret(alice_priv, bob_pub)
alice_session = MatryoshkaProtocol(key=shared_secret)
bob_session = MatryoshkaProtocol(key=shared_secret)
# Send invisible message
msg = alice_session.send_message("Secret meeting at midnight")
# Looks like: {"status": "success", "data": {...}}
# Receive
plaintext = bob_session.receive_message(msg)
```
### 2. Ghost Mode (Perfect Invisibility)
```python
from matp import GhostMode
key = b"shared_secret_key_32_bytes_long!"
alice = GhostMode(key=key)
bob = GhostMode(key=key)
# Send hidden in GitHub API response
cover = alice.send_invisible("Secret data", service="github")
# Returns: {"id": 123456, "login": "user", "bio": "<encrypted>", ...}
# Receive
message = bob.receive_invisible(cover)
```
### 3. Fast Ghost Mode (Speed + Invisibility)
```python
from matp import FastGhostMode
key = b"benchmark_key_32_bytes_padding!!"
alice = FastGhostMode(key=key)
bob = FastGhostMode(key=key)
# 0.01ms latency, perfect invisibility
cover = alice.send("Fast secret message")
message = bob.receive(cover)
```
### 4. Dead Drop Protocol
```python
from matp import DeadDropProtocol
key = b"dead_drop_key_32_bytes_padding!!"
dead_drop = DeadDropProtocol(key=key)
# Alice drops message (no direct connection to Bob)
location = dead_drop.drop_message("secret_spot_42", "The eagle has landed")
# Bob picks up later
message = dead_drop.pickup_message(location)
```
### 5. Group Messaging
```python
from matp import MatryoshkaGroupManager
# Create users
alice = MatryoshkaGroupManager("alice")
bob = MatryoshkaGroupManager("bob")
# Alice creates group
group = alice.create_group("team", "Secret Team")
# Bob joins
invite = group.export_invite()
bob.join_group(invite)
# Alice sends invisible group message
msg = alice.send_to_group("team", "Meeting at 3pm!")
# Returns: {"status": "success", "data": {...}} # Looks like normal API
# Bob receives
received = bob.receive_group_message(msg)
print(received['message']) # "Meeting at 3pm!"
```
### 6. Quantum-Resistant Crypto (Optional)
```python
from matp import quantum
qc = quantum.get_quantum_crypto()
# Generate post-quantum keypair
keypair = qc.generate_kem_keypair()
# Encapsulate shared secret
kem_ct = qc.kem_encapsulate(keypair.public_key)
# Decapsulate
shared_secret = qc.kem_decapsulate(keypair.secret_key, kem_ct.ciphertext)
```
## 📚 API Reference
### Core Classes
- `MatryoshkaProtocol` - 1-to-1 encrypted messaging
- `GhostMode` - Steganographic messaging
- `FastGhostMode` - High-performance steganography
- `DeadDropProtocol` - Asynchronous message drops
- `MatryoshkaGroupManager` - Group messaging
- `quantum.get_quantum_crypto()` - Post-quantum cryptography
## ⚠️ Disclaimer
Research prototype. Use for educational purposes. Not audited for production use.
## 📄 License
Apache 2.0
## 👤 Author
Sangeet Sharma
Raw data
{
"_id": null,
"home_page": "https://github.com/sangeet01/matp",
"name": "matp",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "cryptography, steganography, encryption, messaging, security, matp",
"author": "Sangeet Sharma",
"author_email": "sangeet.music01@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f3/c7/2b707683df5228a30e21fe3bbc35b5ec44a36612b9c54428f8794258719c/matp-0.5.2.tar.gz",
"platform": null,
"description": "# Matryoshka Protocol (MATP)\r\n\r\nInvisible secure messaging with steganography, post-quantum cryptography, and zero-knowledge proofs.\r\n\r\n## \ud83d\udce6 Features\r\n\r\n- **Invisible messaging** - Hide encrypted messages in normal web traffic\r\n- **Post-quantum cryptography** - Kyber-512 KEM and Dilithium-2 signatures\r\n- **Group messaging** - Fractal Group Ratchet for efficient group encryption\r\n- **Zero-knowledge proofs** - Sigma protocol for plausible deniability\r\n- **Multiple steganography modes** - JSON API, EXIF, Fast Ghost\r\n- **Classical crypto fallback** - X25519, Ed25519, AES-256-GCM\r\n\r\n## \ud83d\udce6 Installation\r\n\r\n```bash\r\npip install matp\r\n```\r\n\r\n## \ud83d\ude80 Quick Start\r\n\r\n### 1. Basic 1-to-1 Messaging\r\n\r\n```python\r\nfrom matp import MatryoshkaProtocol\r\n\r\n# Initialize\r\nalice = MatryoshkaProtocol()\r\nbob = MatryoshkaProtocol()\r\n\r\n# Key exchange (X25519)\r\nalice_priv, alice_pub = MatryoshkaProtocol.generate_keypair()\r\nbob_priv, bob_pub = MatryoshkaProtocol.generate_keypair()\r\n\r\nshared_secret = MatryoshkaProtocol.derive_shared_secret(alice_priv, bob_pub)\r\nalice_session = MatryoshkaProtocol(key=shared_secret)\r\nbob_session = MatryoshkaProtocol(key=shared_secret)\r\n\r\n# Send invisible message\r\nmsg = alice_session.send_message(\"Secret meeting at midnight\")\r\n# Looks like: {\"status\": \"success\", \"data\": {...}}\r\n\r\n# Receive\r\nplaintext = bob_session.receive_message(msg)\r\n```\r\n\r\n### 2. Ghost Mode (Perfect Invisibility)\r\n\r\n```python\r\nfrom matp import GhostMode\r\n\r\nkey = b\"shared_secret_key_32_bytes_long!\"\r\nalice = GhostMode(key=key)\r\nbob = GhostMode(key=key)\r\n\r\n# Send hidden in GitHub API response\r\ncover = alice.send_invisible(\"Secret data\", service=\"github\")\r\n# Returns: {\"id\": 123456, \"login\": \"user\", \"bio\": \"<encrypted>\", ...}\r\n\r\n# Receive\r\nmessage = bob.receive_invisible(cover)\r\n```\r\n\r\n### 3. Fast Ghost Mode (Speed + Invisibility)\r\n\r\n```python\r\nfrom matp import FastGhostMode\r\n\r\nkey = b\"benchmark_key_32_bytes_padding!!\"\r\nalice = FastGhostMode(key=key)\r\nbob = FastGhostMode(key=key)\r\n\r\n# 0.01ms latency, perfect invisibility\r\ncover = alice.send(\"Fast secret message\")\r\nmessage = bob.receive(cover)\r\n```\r\n\r\n### 4. Dead Drop Protocol\r\n\r\n```python\r\nfrom matp import DeadDropProtocol\r\n\r\nkey = b\"dead_drop_key_32_bytes_padding!!\"\r\ndead_drop = DeadDropProtocol(key=key)\r\n\r\n# Alice drops message (no direct connection to Bob)\r\nlocation = dead_drop.drop_message(\"secret_spot_42\", \"The eagle has landed\")\r\n\r\n# Bob picks up later\r\nmessage = dead_drop.pickup_message(location)\r\n```\r\n\r\n### 5. Group Messaging\r\n\r\n```python\r\nfrom matp import MatryoshkaGroupManager\r\n\r\n# Create users\r\nalice = MatryoshkaGroupManager(\"alice\")\r\nbob = MatryoshkaGroupManager(\"bob\")\r\n\r\n# Alice creates group\r\ngroup = alice.create_group(\"team\", \"Secret Team\")\r\n\r\n# Bob joins\r\ninvite = group.export_invite()\r\nbob.join_group(invite)\r\n\r\n# Alice sends invisible group message\r\nmsg = alice.send_to_group(\"team\", \"Meeting at 3pm!\")\r\n# Returns: {\"status\": \"success\", \"data\": {...}} # Looks like normal API\r\n\r\n# Bob receives\r\nreceived = bob.receive_group_message(msg)\r\nprint(received['message']) # \"Meeting at 3pm!\"\r\n```\r\n\r\n### 6. Quantum-Resistant Crypto (Optional)\r\n\r\n```python\r\nfrom matp import quantum\r\n\r\nqc = quantum.get_quantum_crypto()\r\n\r\n# Generate post-quantum keypair\r\nkeypair = qc.generate_kem_keypair()\r\n\r\n# Encapsulate shared secret\r\nkem_ct = qc.kem_encapsulate(keypair.public_key)\r\n\r\n# Decapsulate\r\nshared_secret = qc.kem_decapsulate(keypair.secret_key, kem_ct.ciphertext)\r\n```\r\n\r\n## \ud83d\udcda API Reference\r\n\r\n### Core Classes\r\n\r\n- `MatryoshkaProtocol` - 1-to-1 encrypted messaging\r\n- `GhostMode` - Steganographic messaging\r\n- `FastGhostMode` - High-performance steganography\r\n- `DeadDropProtocol` - Asynchronous message drops\r\n- `MatryoshkaGroupManager` - Group messaging\r\n- `quantum.get_quantum_crypto()` - Post-quantum cryptography\r\n\r\n## \u26a0\ufe0f Disclaimer\r\n\r\nResearch prototype. Use for educational purposes. Not audited for production use.\r\n\r\n## \ud83d\udcc4 License\r\n\r\nApache 2.0\r\n\r\n## \ud83d\udc64 Author\r\n\r\nSangeet Sharma\r\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Matryoshka Protocol - Invisible quantum-resistant messaging",
"version": "0.5.2",
"project_urls": {
"Homepage": "https://github.com/sangeet01/matp",
"Repository": "https://github.com/sangeet01/matp"
},
"split_keywords": [
"cryptography",
" steganography",
" encryption",
" messaging",
" security",
" matp"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "3d6e7b974ad85933e73244d427501d9d3d61a74c35a0fca3c0135d7eb5c33534",
"md5": "8fa68f23b3ba574778642ffd6eb61448",
"sha256": "8a156342a3a0638c50d775e61855d75c1e80612df480e3c8fa45bb1551aab8ff"
},
"downloads": -1,
"filename": "matp-0.5.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8fa68f23b3ba574778642ffd6eb61448",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 53083,
"upload_time": "2025-10-21T12:30:08",
"upload_time_iso_8601": "2025-10-21T12:30:08.087914Z",
"url": "https://files.pythonhosted.org/packages/3d/6e/7b974ad85933e73244d427501d9d3d61a74c35a0fca3c0135d7eb5c33534/matp-0.5.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f3c72b707683df5228a30e21fe3bbc35b5ec44a36612b9c54428f8794258719c",
"md5": "005169e89104d92669872c61c5c4c38b",
"sha256": "f7f8dbf47d431da50202c93a528ca9be57378c3ddb47af5f2f41af527db1e12f"
},
"downloads": -1,
"filename": "matp-0.5.2.tar.gz",
"has_sig": false,
"md5_digest": "005169e89104d92669872c61c5c4c38b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 45148,
"upload_time": "2025-10-21T12:30:09",
"upload_time_iso_8601": "2025-10-21T12:30:09.539831Z",
"url": "https://files.pythonhosted.org/packages/f3/c7/2b707683df5228a30e21fe3bbc35b5ec44a36612b9c54428f8794258719c/matp-0.5.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-21 12:30:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sangeet01",
"github_project": "matp",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "cryptography",
"specs": [
[
">=",
"41.0.0"
]
]
},
{
"name": "liboqs-python",
"specs": [
[
">=",
"0.8.0"
]
]
}
],
"lcname": "matp"
}