The library
Every record is built from these tools and nothing else, so a result means the same thing on every machine. This list is generated from the code. A new tool joins the same way a record does, by pull request, but a person reviews it (see Contribute).
Gematria Primus calculator
Type Latin letters or runes. Readings are matched longest first (ING, NG, TH, EO, OE, AE, IA/IO, EA), Q becomes C, as in olp/runes.py.
Key streams
| stream | first terms (mod 29 when used) |
|---|---|
primes | 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, … |
totient_primes | 1, 2, 4, 6, 10, 12, 16, 18, 22, 28, … |
fibonacci | 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, … |
naturals | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, … |
phi | 1, 1, 2, 2, 4, 2, 6, 4, 6, 4, … |
lucas | 2, 1, 3, 4, 7, 11, 18, 29, 47, 76, … |
squares | 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, … |
cubes | 0, 1, 8, 27, 64, 125, 216, 343, 512, 729, … |
triangular | 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, … |
pow2 | 1, 2, 4, 8, 16, 3, 6, 12, 24, 19, … |
pow3 | 1, 3, 9, 27, 23, 11, 4, 12, 7, 21, … |
prime_gaps | 1, 2, 2, 4, 2, 4, 2, 4, 6, 2, … |
emirps | 13, 17, 31, 37, 71, 73, 79, 97, 107, 113, … |
phi_phi_primes | 1, 1, 2, 2, 4, 4, 8, 6, 10, 12, … |
primes_at_phi | 2, 2, 3, 3, 7, 3, 13, 7, 13, 7, … |
p3301 | 3299, 3298, 3296, 3294, 3290, 3288, 3284, 3282, 3278, 3272, … |
pi_digits | 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, … |
catalan | 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, … |
lazy_caterer | 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, … |
cake | 1, 2, 4, 8, 15, 26, 42, 64, 93, 130, … |
Operations
What a recipe can do to runes. Each costs bits: naming the op is log2 11, and each parameter is charged as listed.
| op | does | parameters | costs |
|---|---|---|---|
atbash | x -> 28 - x: read the rune table backwards (“invert the gematria”). | - | the op name only |
shift | x -> x - k (mode sub, the default) or x + k (mode add), mod 29: a Caesar shift along the rune table. | k, mode | + log2 29 for k + 1 for the mode |
vigenere | A repeating key of rune indices, subtracted (or added) rune by rune; runes selected by literal are copied and do not use up a key rune. With retry {"q": ...} it decodes the collision-retry rule of #25 (see _retry). | key, literal, mode, retry | + log2 29 per key rune + the key length + 1 for the mode |
stream | A key stream from a named number sequence (see STREAMS), mod 29, optionally starting skip terms in; obeys literal and retry like vigenere. | literal, mode, name, retry, skip | + which stream + the skip + 1 for the mode |
reverse | Read the region backwards. | - | the op name only |
difference | d_0 = c_0 and d_i = c_i - c_(i-1) (mode sub, the default) or c_i + c_(i-1) (mode add), mod 29, from the runes as they reach this step. First in a recipe it turns a chain cipher c_i = c_(i-1) + p_i + k_i into the plain additive cipher d_i = p_i + k_i, so every other op and family can test chain ciphers; alone it inverts a ciphertext autokey c_i = p_i + c_(i-1). | mode | + 1 for the mode |
recurrence | A key stream from the linear recurrence k_0 = s0, k_1 = s1, k_(n+1) = a*k_n + b*k_(n-1) (mod 29); obeys literal like vigenere. a = b = 1, s0 = 0, s1 = 1 is the fibonacci stream. With b = 0 it is first order and repeats within 29 terms; any such stream repeats within 29^2 - 1 = 840 terms, too long for periodic IoC to see. | a, b, literal, mode, s0, s1 | + 4 log2 29 for a, b and the two seeds + 1 for the mode |
progressive | A repeating key that moves on by step each time it comes round: the j-th key rune used is key[j mod L] + step * floor(j / L) (mod 29), L the key length; obeys literal like vigenere (a copied rune uses no key rune). step 0 is vigenere. Not periodic with period L (it repeats only after 29 L runes when step is not 0), so a flat periodic IoC does not rule it out: the "canon per tonos" reading of issue #318. | key, literal, mode, step | + log2 29 per key rune + the key length + log2 29 for the step + 1 for the mode |
autokey | Undo a plaintext autokey: the first L runes are keyed by the primer (L its length), every later rune by the plaintext L places back, p_i = c_i - f(p_(i-L)) (mode sub, the default) or c_i + f(p_(i-L)) (mode add), mod 29. f is the rune index (map "index", the default) or its Gematria prime mod 29 (map "prime"). The ciphertext autokey is difference; this is the other kind, where the key comes from the plaintext. | map, mode, primer | + log2 29 per primer rune + the primer length + 1 for the map + 1 for the mode |
affine | x -> a*x + b mod 29 (mode add), or its inverse p = a^-1 (c - b) (mode sub, the default). 29 is prime, so every a in 1..28 is invertible and the 812 (a, b) of one mode are every affine map. | a, b, mode | + log2 28 for a + log2 29 for b + 1 for the mode |
substitution | A general monoalphabetic map: mode add sends x to alphabet[x], mode sub (the default) inverts it. alphabet is a permutation of 0..28: a keyed alphabet, or a block permutation such as albam, achbi or akhas (ported from cmbsolver/cmbsolverwp and ekardnam/LPDecrypter, our own code). | alphabet, mode | + log2(29!) for the alphabet + 1 for the mode |
literal | Rule shared by vigenere and stream: these cipher runes or positions are copied as they are and skip the key. | runes | positions | + log2 29 per literal rune, or log2(region length) per literal position |
Statistics
| statistic | measures |
|---|---|
ioc | Index of coincidence, normalised so uniform random text gives about 1.0 (English runes: about 1.7-1.8). |
doublets | How many adjacent pairs are the same rune (expected about (n-1)/29 for random text). |
lag_coincidences | For each lag k in params["lags"], how many i have r[i] == r[i+k] (a Vigenere key length shows as a peak). |
frequencies | Count of each rune, by index 0..28. |
word_lengths | Histogram of word lengths (by the transcription's word marks) in the region: {length: count}. |
prime_sum | Sum of the Gematria prime values of the region (the solved pages use such sums, e.g. for page numbers). |
unigram_distance | How far the region's rune frequencies are from a reference, in bits (KL divergence): params {"to": "uniform"} (0 for perfectly flat; English text is about 0.45) or {"to": "english"} (0 for English-like frequencies). Test a claim about it with a null of random runes: --null K high --null-model uniform. |
periodic_ioc | For each period k in params["periods"]: the mean index of coincidence of the k columns r[j::k] (normalised as ioc, random about 1). A periodic key of length k leaves each column monoalphabetic, so its period and multiples rise toward English (about 1.7-1.8); a flat profile rules periodic keys up to that length out. |
repeated_ngrams | How many n-grams (params["n"], default 3) repeat one seen earlier in the region. Random runes give few; a periodic key over English plaintext gives more (the Kasiski signal). Test with --null K high --null-model uniform. |
repeat_spacings | Kasiski: for every pair of equal n-grams (params["n"], default 3), which factors 2..params["max"] (default 30) divide their distance; {factor: count}. A key length shows as a factor well above its neighbours. |
depth_ioc | Depth test between this region and another (params {"other": region, "max_offset": K, default 0}): the largest, over offsets 0..K, of the index of coincidence of (this[i] - other[i + offset]) mod 29. If both were enciphered with the same stretch of key, the key cancels and the differences carry plaintext structure (above 1); otherwise they look random (about 1). Test with --null K high --null-model uniform. |
adjacent_mi | Mutual information, in bits, of the pairs (r[i], r[i + lag]) (params {"lag": k, default 1, "offdiag": true by default: pairs of equal runes are dropped, so a doublet rule cannot count}). Under any fixed substitution (monoalphabetic, homophonic, a keyword alphabet: each cipher rune stands for one plaintext letter) the value is at least the plaintext's own, because the plaintext is a function of the ciphertext (about 0.8 bits for English runes at lag 1). Independent runes give only the small-sample bias, about 28^2 / (2 n ln 2) bits (0.09 at 13,000 runes, 1.1 at 500), so compare with a null: --null K high. |
entropy | Shannon entropy of the rune frequencies in bits (uniform: log2 29 = 4.858; English runes about 4.2). Ported from mavicmed/lphelper's statistics. |
adjacent_mi_profile | adjacent_mi at each lag in params["lags"] (offdiag as there): {lag: bits}. A ciphertext autokey at lag L under any fixed alphabet shows as a peak of several tenths of a bit at L; independent runes sit at the small-sample bias at every lag (proposal #344). |
lag_z | For each lag k in params["lags"]: how far the share of equal runes k apart is above 1/29, in standard deviations (z). A key that repeats every P runes lifts z at every multiple of P (to about +4 or more on a long section), so the largest z over well-chosen lags tests a whole family of periodic keys at once. |
Judges
| test | asks |
|---|---|
score | Is the output more English-like than random runes, after paying for every bit of the recipe? (trigram model, threshold 10-6) |
words | Do dictionary words fall between the transcription's own word separators more often than chance? Shown for a solution as supporting evidence, not required (Cicada's own spellings, such as “widsom”, are in no dictionary). |
power | Would real English of this length have stood out? A dead end excludes only if at least 95% would. |
structure | Any language: are the output's rune frequencies far from random? A provable bound, paid like the others plus one bit. A hit is a structure lead (◆): a person looks; it is never a solution. |
family | Numbers every member of a search, so anyone can replay all of it, or one shard. |
Details and their limits: docs/VERIFICATION.md.