Kasiski Examination Period Guesser

Count actual repeated-ngram position-pair distances and divisor votes, overlapping ngrams explicit; candidates not a recovered key length. Classical educational encoding only; not secure encryption, no hidden normalization or inferred key.

Description

Kasiski examination considers distances between repeated letter groups.

Kasiski examination considers distances between repeated letter groups.1

Divisibility votes suggest candidate periods but do not choose a unique key length. Use Kasiski Examination Period Guesser to evaluate the supplied inputs under the specific model below.

When to use Kasiski Examination Period Guesser

Use Kasiski Examination Period Guesser to evaluate the supplied inputs under the specific model below. Choose the intended encoding, alphabet or check and keep the exact character, key and measurement conventions described below.

How to use Kasiski Examination Period Guesser and understand its results

  1. Choose the intended encoding, alphabet or check and keep the exact character, key and measurement conventions described below.
  2. Enter Text, Ngram length, Max candidate period using the field table and validation rules below, then run the tool.
  3. Read Repeated ngram distances, Candidate periods, Distance divisibility votes and interpret units, signs, ordering and placeholders as explained below.
  4. If the tool reports an input error, correct that field and rerun. A successful false result, empty match list or unknown-evidence placeholder has the specific meaning described here; check the limitations before applying the result.
Input fieldMeaningValue typeRequirement
textTextstringRequired; constraints below
ngramLengthNgram lengthnumberRequired; constraints below
maxCandidatePeriodMax candidate periodnumberRequired; constraints below

Enter uppercase A–Z text of at most 512 characters, an n-gram length from 2 to 8 and maximum period from 2 to 128. Collect overlapping positions of repeated n-grams and distances between every pair of their occurrences. Count distances divisible by each period from 2 through the maximum, preserving that period order. More than 10000 pair distances is rejected; short or empty text yields no distances and zero votes. Votes suggest candidates without identifying a key.

vote[p] = count(repeatedNgramPairDistances divisible by p), for p=2..maximum

Field order, units and branch conditions follow the implementation explanation above.

Output fieldMeaningValue type
repeatedNgramDistancesRepeated ngram distancesarray of number
candidatePeriodsCandidate periodsarray of number
distanceDivisibilityVotesDistance divisibility votesarray of number
json
{
  "input": {
    "text": "ABCABCABC",
    "ngramLength": 3,
    "maxCandidatePeriod": 6
  },
  "output": {
    "repeatedNgramDistances": [
      3,
      6,
      3,
      3,
      3
    ],
    "candidatePeriods": [
      2,
      3,
      4,
      5,
      6
    ],
    "distanceDivisibilityVotes": [
      1,
      5,
      0,
      0,
      1
    ]
  }
}

Limitations and assumptions

Divisibility votes suggest candidate periods but do not choose a unique key length. Apply the exact scope and assumptions described above.

All listed fields require explicit values. Unexpected fields, incorrect types, nonfinite numbers and sparse arrays fail validation. Domain-specific bounds, alignments and supported tokens are stated above; extremely large inputs or outputs can also be rejected. These errors differ from successful results such as false, no matches or unknown evidence.

Alternative or Complementary methods

Use Vigenère Key-Length IoC Estimator for a related task: Index of coincidence compares repeated letters within candidate key-position columns.

Use Bigram English Fitness Score for a related task: Bigram fitness sums corpus-dependent log scores for adjacent symbol pairs.

References

  1. Kasiski Examination Period Guesser — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies