DEV Community

Cover image for Chrono-Library Messenger: How to send a message without transmitting a single bit.๐Ÿ’ซ
Alexander Suvorov
Alexander Suvorov

Posted on

Chrono-Library Messenger: How to send a message without transmitting a single bit.๐Ÿ’ซ

What if I told you that you could send a message without transmitting a single bit of information? No encrypted packets, no metadata, nothing. It sounds like magic, but it's actually cryptography. Let me introduce you to Chrono-Library Messenger (CLM) โ€” a Python CLI tool that rethinks secure communication from the ground up.


๐Ÿ” The Problem with "Normal" Messaging

Even the most secure messengers have a fundamental trait: they transmit data. They send encrypted packets from sender to receiver. This means:

  • ๐Ÿ“ก Metadata is exposed: Who is talking to whom, and when.
  • ๐Ÿšซ It may be blocked: The communication channel may not be working, may be disconnected or blocked.
  • โš”๏ธ It can be attacked: The communication can be subjected to DDoS or man-in-the-middle attacks on the channel.

๐Ÿ’ก The Insight: What if We Send Nothing?

CLM is based on a radical idea: What if there is no data transmission? Instead, two parties synchronously extract the message from a shared, predetermined pseudorandom sequence โ€” an "Eternal Library."

You don't send messages. You publish coordinates. The recipient recreates the message locally using the same coordinates and a shared secret.


๐Ÿง™โ€โ™‚๏ธ The Magic Trick: How It Works

Let's use a simple metaphor. Imagine you and a friend have an identical, infinite book of random numbers (the Eternal Library).

  1. To "send" a message: You agree on a specific page and line in this book. You take your message and combine it (using XOR) with the random numbers on that line. You then publicly tell your friend: "Look at page 1736854567, line 'general_chat'." You never send the message itself or the random numbers.
  2. To "receive" a message: Your friend opens their identical copy of the book to the exact same page and line. They take the numbers from that line and combine them (XOR) with the data you posted. Like magic, the original message appears.

The message never left your device. Only the coordinatesโ€”the pointerโ€”were shared. The message was "extracted" from a shared, pre-synchronized data structure.


โš™๏ธ The Technical Spellbook

This magic is powered by a few key ingredients:

  1. ๐Ÿ—๏ธ The Shared Secret (master_seed): A pre-shared passphrase that seeds our entire "Library." Without it, the pointers are useless noise.
  2. ๐Ÿ’ฌ Chat Realms (seed_suffix): Each chat has a unique suffix (e.g., general, secrets), creating separate sections within the Library.
  3. โฐ Time as a Page Number (epoch_index): We use the current Unix time as the "page number" to ensure we're always looking at a new, unique page. This makes every message unique.
  4. ๐Ÿ“˜ HMAC_DRBG: A cryptographically strong Deterministic Random Bit Generator based on HMAC-SHA256. It generates a predictable, endless stream of random-looking data from our seed. This is our "book."
  5. ๐Ÿ” XOR Cipher: The humble XOR operation is used for "encryption." It's perfect because it's reversible: (message XOR key) XOR key = message.

Here's the core code that makes it happen:

Generating the "page" of the book (the key):

# The seed is a combination of master_seed, chat suffix, and current time
seed_material = f"{master_seed}_{chat_seed_suffix}_{epoch_index}".encode()
drbg = HMAC_DRBG(seed_material) # Initialize our generator
key_bytes = drbg.generate(len(message_bytes)) # Generate the key from this "page"
Enter fullscreen mode Exit fullscreen mode

"Encrypting" and "decrypting" the message:

def encrypt_decrypt(data, key):
    return bytes([d ^ k for d, k in zip(data, key)])

# Sender's side
ciphertext = encrypt_decrypt(message_bytes, key_bytes)

# Receiver's side
decrypted_bytes = encrypt_decrypt(ciphertext, key_bytes)
message = decrypted_bytes.decode('utf-8')
Enter fullscreen mode Exit fullscreen mode

The public pointer is just a JSON object:

{
  "c": "1",
  "e": 1736854567,
  "d": "8d3e12a45b..."
}
Enter fullscreen mode Exit fullscreen mode
  • c: Chat ID (the bookshelf)
  • e: Epoch index (the page number)
  • d: Ciphertext (the result of XOR)

๐ŸŒŸ Why This is So Powerful (And a Little Crazy)

  • ๐ŸŒ Does not depend on the Internet: You don't need the internet to "send" a message. You can communicate the pointer via SMS, a QR code, a post on social media, or a note in a tree hole. The channel doesn't matter.
  • ๐Ÿ‘ป Plausible Deniability: The pointer {"c": "1", "e": 1736854567, "d": "a1b2c3..."} is indistinguishable from random junk. "This? It's just a JSON config for my coffee machine."
  • ๐Ÿ–ฅ๏ธ No Server, No Provider: There is no middleman. Everything is stored locally on your device.
  • โ™พ๏ธ Eternal: If you have the shared secret and the pointer, you can decode the message 100 years from now. No servers required.

โš ๏ธ The Inevitable Limitations

This is an experimental version and not a daily use product.

  • ๐Ÿ”‘ The Key Exchange Problem: You still need to share the master_seed securely (e.g., in person). It doesn't solve the initial key distribution.
  • ๐Ÿ“Š Metadata: While the message is hidden, the chat ID (c) and timestamp (e) in the pointer are public.
  • ๐Ÿ”“ No Forward Secrecy: If the master_seed is compromised, all messages in all chats can be decrypted.

๐ŸŽฏ Conclusion: A Thought Experiment Come to Life

Chrono-Library Messenger (CLM) isn't here to replace other messengers. It's a thought experiment, a demonstration that we can look at the problem of private communication from a completely different angle. It shows that sometimes, the most secure way to send a message is not to send it at all.

If you find this concept as fascinating as I do, check out the project on GitHub, star it, and maybe even contribute! Let's discuss the future of private communication.

GitHub Repository: ๐Ÿ‘‰ Alexander Suvorov / chrono-library-messenger

I was inspired by my other projects:

smartpasslib - A cross-platform Python library for generating deterministic, secure passwords that never need to be stored.

clipassman - Cross-platform console Smart Password manager and generator.

Smart Babylon Library - A Python library inspired by the Babylonian Library and my concept of smart passwords. It generates unique addresses for texts without physically storing them, allowing you to retrieve information using these addresses.


๐Ÿ”ฎ Open for Collaborations!
I'm passionate about crazy ideas, unconventional thinking, and fresh perspectives on complex problems. If you're working on something innovative and need a unique mindset, I'm always open to collaborating on exciting projects.
Get in touch: Alexander Suvorov (GitHub)


๐Ÿ“œ Legal & Ethical Disclaimer:
Chrono-Library Messenger (CLM) is a proof-of-concept project created for academic, research, and educational purposes only. It is designed to explore alternative paradigms in communication technology. The author does not encourage or condone the use of this tool for any illegal activities or to violate the laws of any country. The mention of other messaging services is made for comparative analysis within a technological context and constitutes fair use. Users are solely responsible for ensuring their compliance with all applicable local, national, and international laws and regulations.

Top comments (0)