a project on cryptography

Before ciphers had a name, India already kept its secrets.

Two thousand years before modern encryption, rulers, spies and merchants across the subcontinent were already scrambling letters, hiding words inside flowers, and writing messages meant for one reader alone. This project walks through how — and lets you try their methods yourself.

2,300+ yrssince the Arthashastra
4core techniques covered
26letters, thousands of keys
turn the inner disc shift 3
DUWKDVKDVWUD
Why it mattered

A kingdom's words were as valuable as its treasury

A message that fell into the wrong hands could cost a battle, a border, or a throne. Ancient Indian statecraft treated secure communication as seriously as it treated the army — the Arthashastra devotes entire chapters to spies, envoys and the discipline of secrecy.

Kingdom security

Plans, troop counts and treasury details had to stay unreadable to anyone but the intended official.

Military movement

Orders about troop positions and timing of an advance were disguised so an intercepted rider gave nothing away.

Diplomacy

Envoys carried terms between rival courts that neither side wanted a third kingdom to read first.

Trade routes

Merchant guilds coded prices and cargo manifests to keep rivals from undercutting a route before it arrived.

Where we know this from

Four texts that wrote the rules of secrecy

None of this is guesswork — classical Indian literature describes these methods directly, sometimes in surprising places. Click a card to see what each source actually says.

Arthashastra

Kautilya's treatise on statecraft lays out an entire intelligence service — agents, handlers and secret writing for reports that could not be trusted to plain language.

Kautilya, c. 4th–2nd c. BCE
Did you know?

The text names a specific letter-substitution method for spies, now referred to by scholars as the "Kautiliyam" cipher.

Tap to flip back

Kamasutra

Best known for other subjects, Vatsyayana's text also lists the 64 arts a cultured person should know — and secret writing is one of them.

Vatsyayana, c. 2nd–3rd c. CE
Did you know?

The skill is called mlecchita-vikalpa — "the art of understanding writing in cipher" — placed alongside music, cooking and chess.

Tap to flip back

Manusmriti

This early legal and governance text touches on the conduct expected of ministers handling confidential state matters.

c. 2nd c. BCE – 2nd c. CE
Did you know?

It reinforces a wider pattern in classical India: secrecy in administration was treated as a matter of law, not just habit.

Tap to flip back

Brihaddeshi

A treatise on music and poetics that shows coded language was not only for spies — it shaped art and performance too.

attributed to Matanga, c. 6th–8th c. CE
Did you know?

Layered, riddling language in poetry and song let performers embed a second meaning for listeners who knew where to look.

Tap to flip back
Try it yourself

Four techniques, live in your browser

These are simplified, browser-friendly versions of the same four families of technique the ancient texts describe. Type your own message into each one.

Substitution replaces every letter with a different one, using a fixed key both sender and reader must know in advance — the same principle behind the Kautiliyam cipher described in the Arthashastra.

Here the key is built from a keyword: unique letters of the word first, then the rest of the alphabet in order.

Transposition keeps every original letter but changes the order — writing a message in a zigzag across several rows, then reading the rows straight across.

Choose how many rows (rails) to zigzag across.

Steganography hides the fact a secret exists at all — the message is buried inside something innocent, like the first letters of an ordinary-looking line.

Type a short hidden word; each of its letters becomes the first letter of a word in an everyday-looking sentence.

read only the first letter of each word

Code words replace an entire idea with an unrelated, harmless-sounding word — agreed on before anyone needed to use it. No cipher alphabet at all, just a shared secret vocabulary.

Click a card to reveal what a scout's report might really have meant.

Beyond the alphabet

Secrecy didn't always need a cipher at all

Alongside letter-based methods, everyday materials and gestures carried hidden meaning — often safer than any written cipher, since they didn't look like a message in the first place.

Invisible ink on palm leaf

Messages written with milk or lemon juice on tada patra stayed blank until gently heated, at which point the writing darkened into view.

Knotted thread

The number, spacing and pattern of knots tied into a cord encoded a message that looked like nothing more than a piece of string.

Flower garland order

The specific arrangement and colour sequence of flowers strung into a garland could signal a status or a warning to those trained to read it.

Hand gestures and code words

Couriers and spies used pre-agreed hand signals and spoken code words so a message could pass in plain sight during an ordinary conversation.

Why this still matters

The instinct behind modern encryption is not new

1

It shows deliberate strategic thinking. These weren't accidents of language — they were designed systems, taught and written down as a discipline in their own right.

2

It laid groundwork later systems built on. Substitution, transposition, hidden text and shared code vocabularies are still the four basic families every modern cipher descends from.

3

The core idea never changed. A message should be meaningless to anyone except the person it was written for — that principle is exactly what today's encryption is built to guarantee.

Click the seal to break it open

What began as a spy's coded report on palm leaf became, two thousand years later, the encryption protecting a message on your phone — the thread never really broke.