Under construction. A new version of this site is being built. Everything here still works: records still verify and contributions are still accepted.

open-liber-primus · library

Library

What the checker can do, listed from its code.

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

streamfirst terms (mod 29 when used)
primes2, 3, 5, 7, 11, 13, 17, 19, 23, 29, …
totient_primes1, 2, 4, 6, 10, 12, 16, 18, 22, 28, …
fibonacci0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …
naturals0, 1, 2, 3, 4, 5, 6, 7, 8, 9, …
phi1, 1, 2, 2, 4, 2, 6, 4, 6, 4, …
lucas2, 1, 3, 4, 7, 11, 18, 29, 47, 76, …
squares0, 1, 4, 9, 16, 25, 36, 49, 64, 81, …
cubes0, 1, 8, 27, 64, 125, 216, 343, 512, 729, …
triangular0, 1, 3, 6, 10, 15, 21, 28, 36, 45, …
pow21, 2, 4, 8, 16, 3, 6, 12, 24, 19, …
pow31, 3, 9, 27, 23, 11, 4, 12, 7, 21, …
prime_gaps1, 2, 2, 4, 2, 4, 2, 4, 6, 2, …
emirps13, 17, 31, 37, 71, 73, 79, 97, 107, 113, …
phi_phi_primes1, 1, 2, 2, 4, 4, 8, 6, 10, 12, …
primes_at_phi2, 2, 3, 3, 7, 3, 13, 7, 13, 7, …
p33013299, 3298, 3296, 3294, 3290, 3288, 3284, 3282, 3278, 3272, …
pi_digits3, 1, 4, 1, 5, 9, 2, 6, 5, 3, …
catalan1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, …
lazy_caterer1, 2, 4, 7, 11, 16, 22, 29, 37, 46, …
cake1, 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.

opdoesparameterscosts
atbashx -> 28 - x: read the rune table backwards (“invert the gematria”).-the op name only
shiftx -> 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
vigenereA 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
streamA 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
reverseRead the region backwards.-the op name only
differenced_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
recurrenceA 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
progressiveA 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
autokeyUndo 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
affinex -> 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
substitutionA 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
literalRule 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

statisticmeasures
iocIndex of coincidence, normalised so uniform random text gives about 1.0 (English runes: about 1.7-1.8).
doubletsHow many adjacent pairs are the same rune (expected about (n-1)/29 for random text).
lag_coincidencesFor each lag k in params["lags"], how many i have r[i] == r[i+k] (a Vigenere key length shows as a peak).
frequenciesCount of each rune, by index 0..28.
word_lengthsHistogram of word lengths (by the transcription's word marks) in the region: {length: count}.
prime_sumSum of the Gematria prime values of the region (the solved pages use such sums, e.g. for page numbers).
unigram_distanceHow 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_iocFor 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_ngramsHow 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_spacingsKasiski: 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_iocDepth 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_miMutual 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.
entropyShannon 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_profileadjacent_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_zFor 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

testasks
scoreIs the output more English-like than random runes, after paying for every bit of the recipe? (trigram model, threshold 10-6)
wordsDo 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).
powerWould real English of this length have stood out? A dead end excludes only if at least 95% would.
structureAny 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.
familyNumbers every member of a search, so anyone can replay all of it, or one shard.

Details and their limits: docs/VERIFICATION.md.

Curiosity above all. Nobody here is paid, ranked or promised anything. The Liber Primus is worked on because it is interesting: a careful dead end, an odd statistic, a better tool, a good question, all count. Bring your curiosity; the checker keeps us honest.