Skip to main content

Matryoshka Protocol - Invisible secure messaging

Project description

Matryoshka Protocol (MATP)

Invisible secure messaging with perfect steganography

Features

  • Perfect Invisibility: Messages indistinguishable from normal web traffic (ε → 0)
  • Production Crypto: AES-256-GCM + X25519 + Double Ratchet
  • Fast Ghost Mode: 0.01ms overhead for invisibility
  • Dead Drop Protocol: No direct communication required
  • Service Diversity: Mimics GitHub, Stripe, AWS APIs
  • Group Messaging: Fractal Group Ratchet with O(1) encryption
  • Invisible Groups: Group messages hidden in normal traffic

Installation

pip install matp

Quick Start

Basic 1-to-1 Messaging

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)

Ghost Mode (Perfect Invisibility)

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)

Fast Ghost Mode (Speed + Invisibility)

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)

Dead Drop Protocol

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)

Group Messaging

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!"

Security Properties

  • Encryption: AES-256-GCM (authenticated encryption)
  • Key Exchange: X25519 (elliptic curve Diffie-Hellman)
  • Forward Secrecy: Double ratchet protocol
  • Steganographic Security: ε < 0.001 (indistinguishable from real traffic)
  • Plausible Deniability: Messages look like normal API calls

Performance

Mode Latency Throughput Invisibility
Standard ~2ms 500 msg/s ε < 0.01
Fast Ghost ~0.01ms 160K msg/s ε < 0.001

Use Cases

  • Secure messaging in restrictive environments
  • Covert communication channels
  • Privacy-preserving protocols
  • Research in steganography

License

Apache 2.0

Author

Sangeet Sharma

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matp-0.3.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matp-0.3.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file matp-0.3.0.tar.gz.

File metadata

  • Download URL: matp-0.3.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for matp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0be7f731b4ff96db7efa0c873329f9ab23ae7016088982d8166eed61f54b8fae
MD5 7494ccd766efaaed67c325514c2252b3
BLAKE2b-256 0704f06cd0a7e718e031165cd1eaef44f23f086d78be1ac4b203cdb93925be75

See more details on using hashes here.

File details

Details for the file matp-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: matp-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for matp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d01f654a8f686d92e33b5d44b5c03245d0fbf4732bb76e05f080d7b472de70b
MD5 8d73fdfb96151be0d511644bf8e7bccb
BLAKE2b-256 7236fed1d74b4fcae363228f50433e1f1a9af626cc4195a833867dae7660dc2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page