Guide

Playground

The page behind ciphers.agntn.dev/playground runs the library in your browser. What it can tell you and what it can't.

The Playground imports @agntn/ciphers into the page and runs it in your browser. Every encode, decode, brute force and histogram is the library's own answer, the same code the CLI and the agent tools run. Nothing is sent anywhere. The docs worker serves the page and that's the end of its involvement.

OperationRunsTool equivalent
Encodecreate(cipher).encode(text, options)cipher_encode
Decodecreate(cipher).decode(text, options)cipher_decode
Brute forcecreate("caesar").decode(text, { shift }) for 1 to 25cipher_brute_caesar
FrequencyanalyzeFrequency(text, language)cipher_frequency

The option fields come from create(cipher).info().options. A cipher that gains an option shows it without anyone touching the page. preserveCase and stripNonAlpha are the two flags every cipher shares.

The form writes itself into the address: /playground?op=encode&cipher=vigenere&text=ATTACK+AT+DAWN&key=LEMON opens the page on that answer. Paste it to someone and they see what you saw. The permalink button copies the current one.

The two snippets

Under the result the page prints the same call as a CLI line and as a tool invocation in JSON, both with copy buttons. They are built from the form, so what you copy is what you ran. Not an example that looks like it.

The landing

The panels on the home page walk through the eighteen ciphers with one sample sentence each, computed the same way, in the browser, on one clock. Hover a panel to pause it. The arrows under the code step it by hand.

@agntn/ciphers·MIT license· Classical ciphers, for lessons and puzzles. Not for protecting anything, ever.