DIOLSA
A symmetric cipher that hides not only what you say, but how long your messages are, when you send them, and whether you are talking at all.
What it is
A symmetric cipher: both sides share one secret key. It encrypts one byte at a time, so it works for any text in any language, emoji included.
What it hides
The words, the exact length, the moment you send, and whether you are talking at all. Standard ciphers hide only the first.
Where the name comes from
DIO for the linear Diophantine equation that encrypts every byte.
Three ideas, one cipher
How Gauss's theorem encrypts a byte
The units of a number n are the numbers below n that share no factor with it. Gauss generalised Wilson's theorem by finding what you get when you multiply all the units of n together: always +1 or −1 modulo n. DIOLSA takes the secret key k and multiplies it by 4 or by 15, so that its modulus n = 4k or 15k always lands in the +1 case.
To encrypt a byte b (a number from 0 to 255), DIOLSA multiplies the first b + 1 units and sends the inverse z of that product modulo n. It finds z by solving a linear Diophantine equation. Because the product of all units is 1, z is exactly the product of all the units that were not used: the ciphertext is “everything that is left”.
The receiver, who knows n, multiplies z by e1, then by e2, and so on, until the result is 1. The number of steps gives back the byte. Without n, z is just a 78-digit number that looks random.
A huge number makes a new key for every byte
The master key only starts the process: it never encrypts a single byte. In each round, the sender picks a random unit ε of n and sends it in secret, each of its 78 digits under its own key. Then both sides multiply the 501 units of n that follow ε:
This giant number M goes through SHA-256 together with secret values, and out come 1000 fresh 256-bit keys, one for each of the next 1000 bytes. Every key brings its own modulus, so each byte is encrypted with a different n. A key is erased the moment it has been used. A separate “next seed”, also made from M, starts the next round. Even someone who breaks into a device later cannot read past messages.
Noise: decoys and the endless stream
A decoy is a random unit z chosen so that its inverse is none of the 256 products the receiver checks. When the receiver tries it, the running product never reaches 1, so the decoy is thrown away and the key chain does not move. To anyone else, a decoy looks exactly like a real tuple. The receiver needs no extra signal to tell them apart.
The one-byte lab
Pick a small key and a character. This runs the real DIOLSA symbol map in your browser. Real keys are 78 digits long; tiny ones just make the numbers easy to read.
Try changing one digit of k: the same character gives a completely different z. In the real cipher, k changes for every byte.
Bob multiplies z by e₁, e₂, e₃ … and stops at the first 1 (highlighted). The number of steps is the byte.
Choose how much shape to hide
Default
Only real tuples are sent. The words are hidden; the length of each message still shows, as with standard ciphers. Fastest and smallest.
Block mode
Decoys fill every message up to a fixed size, so “yes” and a long paragraph look identical. Longer messages fill the next multiple. A stream cipher that looks like a block cipher.
Stream mode
The line is never quiet. One tuple goes out in every time slot of random length. If a real byte is waiting, it goes; if not, a decoy goes instead. Eve sees the same steady flow whether you type, think, or are gone.
What an eavesdropper learns
| The eavesdropper learns… | AES-GCM / ChaCha20 | DIOLSA · blocks | DIOLSA · stream |
|---|---|---|---|
| The words | No | No | No |
| The exact length | Yes | No, only the block size | No |
| When a message is sent | Yes | Yes | No |
| Whether anyone is talking | Yes | Yes | No |
| A changed or missing piece | Detected | Detected, channel closes | Detected, channel closes |
Built in, not bolted on
Standard ciphers leave length and timing protection to each application. DIOLSA has it in the cipher itself.
A fresh key for every byte
The SHA-256 key chain never reuses a key. Two messages with the same master key never share one, thanks to a random 128-bit nonce.
Forward secrecy
Used keys, digit keys, old seeds and the master key in chat are erased as soon as they are no longer needed.
Tamper seals
Every tuple carries a number and an HMAC seal. A changed, lost, extra or reordered tuple closes the chat at once.
Replay check
Old messages cannot be sent again: anything older than 30 days or replayed is refused.
Any language
Text becomes UTF-8 bytes: a plain letter is 1 tuple, an accented letter 2, most emoji 4.
Key exchange
The master key can come from Diffie-Hellman, ECDH (X25519), a key file, or a long key typed together in person.
DIOLSA in figures
Constants of the reference implementation, protocol diolsa-v4.
| Alphabet | 256 symbols (one byte each) |
| Modulus | n = 4k or 15k · 78 digits |
| Key size | 256 bits (DH/ECDH) · ≥ 30 digits typed |
| Chain span | 501 units per product M |
| Size of M | ≈ 116,500 bits |
| Keys per round | 1000 |
| Nonce | 128 random bits |
| Seals | HMAC-SHA256, 128 bits |
| Message age limit | 30 days · 5 min clock skew |
Open for review
DIOLSA has no security proof yet, and we say so. Good cryptography is tested in public.
The specification reports a first security analysis, including two attacks we ran ourselves on the reference code and a structural weakness in the key chain of the previous version (diolsa-v3) that the current version fixes. With known plaintext, an attacker can recover the key of a single small byte; in diolsa-v4 that key unlocks only that one byte, which the attacker already knew. For printable text we have no attack, and no proof.
We ask cryptographers to read the open questions in the specification and try to break it.
FAQ
Is DIOLSA a replacement for AES?
Doesn't stream mode use more data?
How does the receiver know which tuples are decoys?
Why multiply k by 4 or 15?
What if someone steals my phone later?
Read more
DIOLSA: Specification of a Block and Stream Cipher
The full algorithm as implemented in the reference code (protocol diolsa-v4), its mathematics with proofs, and a first security analysis with open questions for reviewers.
Overview · for everyone · 4 pagesHiding the Shape of Your Messages
A plain-language introduction: why encryption alone does not hide the length and timing of your messages, and how DIOLSA does.
Watch Eve see nothing
Alice and Bob chat with DIOLSA. Press EVE to see only what an eavesdropper sees on the wire. Switch between default, block and stream mode and watch the shape of the conversation disappear.
