Cracking Vigenère in Non-English Text: Frequency Models and Language Assumptions
A Vigenère cipher does not become mathematically different when the plaintext changes from English to Spanish, French, or German.
The cryptanalysis can.
Once a likely key period is known, a common attack splits the ciphertext into recurring columns and solves each column as a Caesar shift. The scoring step usually asks:
Which shift makes this column look most like ordinary language?
That question contains a hidden input:
which language?
An English frequency table is not a neutral model of alphabetic text. Spanish, French, German, and English distribute their letters differently. Wellesley College teaching material, for example, uses different high-frequency-letter tables for English, German, French, and Spanish when demonstrating language identification from letter frequencies: language-frequency exercise.
This article measures what that assumption can do to Vigenère key recovery.
The controlled benchmark holds the cipher constant:
cipher: standard A–Z Vigenère
key: ORBIT
period: 5
period supplied to the cracker
scoring: chi-squared
training size: 500 letters per language
Only the language model changes.
On the 150-letter non-English samples, an English model recovers the complete key in:
9 / 19 trials
47.4%
Language-matched models recover it in:
19 / 19 trials
100.0%
At 300 letters, the English model improves to:
6 / 9
66.7%
while the matched models remain:
9 / 9
100.0%
The result is not “English frequencies always fail on foreign text.”
They do not.
French is surprisingly forgiving in this experiment, and the 300-letter German blocks are all recoverable with the English model.
The more accurate conclusion is:
a mismatched language model increases the risk of selecting the wrong Caesar shifts, especially when each Vigenère column is short. More ciphertext can sometimes overcome that mismatch, but it does not guarantee that it will.
If you already know the key and only need to transform text, use the Vigenère Cipher Decoder and Encoder. The problem here is statistical key recovery when the plaintext language may not be English.
The Vigenère arithmetic does not know what language it is encrypting
For standard additive Vigenère:
Cᵢ = (Pᵢ + Kᵢ) mod 26
The formula sees integers from 0 through 25.
It does not see:
English
Spanish
French
German
If the same A–Z representation is used, the encryption operation is unchanged.
The language enters later, when the attacker tries to decide which candidate decryption is plausible.
Suppose the period is 5.
The ciphertext is split into five streams:
positions 1, 6, 11, 16, ...
positions 2, 7, 12, 17, ...
...
Each stream was shifted by one key letter.
To recover that shift, a chi-squared attack compares the candidate plaintext distribution with an expected language distribution.
Change the expected distribution, and the winning shift can change.
Why English is not a universal frequency model
The most common letters are not weighted equally across languages.
Even after reducing all four languages to the same 26-letter A–Z alphabet, the 500-letter training samples in this benchmark have visibly different leading frequencies.
| Language model | Eight most frequent letters in its 500-letter training sample |
|---|---|
| English | E 12.2%, T 8.6%, I 8.4%, N 7.6%, O 7.6%, A 7.0%, S 6.8%, H 6.8% |
| Spanish | A 14.8%, E 10.2%, O 9.6%, S 8.6%, N 8.2%, L 7.6%, U 5.4%, R 5.2% |
| French | E 17.2%, I 8.8%, N 8.2%, U 8.2%, T 7.8%, A 6.8%, S 6.0%, O 5.6% |
| German | E 14.4%, I 8.8%, N 8.2%, R 8.2%, H 7.4%, S 6.8%, U 5.8%, A 5.6% |
These are sample measurements, not universal language constants.
The important point is the shape.
For example, the Spanish sample places much more weight on A than the English sample. The French sample gives E an especially large share. The German sample emphasizes a different combination of E, I, N, R, and H.
A Caesar-shift scorer is trying to align a ciphertext column with one of these shapes.
The wrong target shape can make the wrong shift look better.
Normalization is part of the language model
The experiment deliberately uses a 26-letter classical profile.
Normalization is:
uppercase
Unicode diacritics decomposed
retain A–Z only
German ß → SS
So examples become:
é → E
ñ → N
ü → U
ß → SS
This is one controlled choice.
It is not linguistically neutral.
Removing accents merges symbols that are distinct in normal writing. Converting ß to SS changes both length and frequencies. Another implementation might convert German umlauts as:
ä → AE
ö → OE
ü → UE
instead of:
A
O
U
Those choices change the frequency model.
The rule for cryptanalysis is therefore simple:
train and score under the same normalization policy.
A frequency table built from accent-stripped Spanish should not be mixed casually with ciphertext produced under a different alphabet policy.
Benchmark source material
Four native-language sources are used.
English comes from the previously verified normalized Chapter I corpus of Alice’s Adventures in Wonderland.
The non-English excerpts are public-domain Project Gutenberg texts:
Spanish:
Don Quijote
Miguel de Cervantes
eBook #2000
chapter opening beginning “En un lugar...”
French:
Les misérables Tome I: Fantine
Victor Hugo
eBook #17489
chapter opening beginning “En 1815...”
German:
Faust: Der Tragödie erster Teil
Johann Wolfgang von Goethe
eBook #2229
“Nacht” beginning “Habe nun, ach!...”
After the stated normalization, the available source lengths are:
| Language | Normalized letters |
|---|---|
| English | 6,498 |
| Spanish | 1,474 |
| French | 1,411 |
| German | 1,576 |
For every language, exactly the first:
500 letters
build its frequency model.
Those 500 letters are not used as test plaintext.
Everything after position 500 is held out for encryption and key recovery.
Why smooth the frequency models?
A 500-letter training sample is intentionally small.
A rare letter may be absent entirely.
Ordinary chi-squared needs a positive expected count for every category it evaluates, so the benchmark uses add-0.5 smoothing:
p(letter)
=
count(letter) + 0.5
--------------------
500 + 0.5 × 26
This prevents a missing training letter from creating a zero expected frequency.
The same smoothing rule is used for all four languages.
That makes the comparison about the observed frequency distributions rather than about one model receiving special handling.
The period is supplied on purpose
This benchmark does not ask the language model to discover the key length.
The true period is given:
5
That isolates one question:
Once the period is known, how does the assumed plaintext language affect recovery of the five Caesar shifts?
Period detection has its own language dependencies.
Kasiski uses repeated-string distances and does not need a monogram table. Average-column Index of Coincidence can rank periods without supplying an English frequency vector, although the expected magnitude of IC depends on the underlying language. The Friedman estimate goes further and explicitly relies on assumptions about language coincidence.
Those earlier stages are covered by the key-length methods comparison.
Here, the period is fixed so a wrong key cannot be blamed on a wrong period.
The recovery procedure
Every held-out block is independently encrypted with:
ORBIT
starting from O at the first block character.
For each test block:
1. encrypt with ORBIT;
2. split the ciphertext into five recurring columns;
3. try all 26 Caesar shifts for each column;
4. score each shifted column against one language model;
5. choose the lowest chi-squared shift;
6. combine the five winning shifts into a key;
7. count success only if the complete recovered key is ORBIT.
The chi-squared calculation is:
χ²
=
Σ (observed - expected)² / expected
There is no dictionary and no n-gram rescue stage.
That matters because the experiment is specifically testing the language assumption in monogram key recovery.
150-letter result: language mismatch matters most here
At 150 ciphertext letters, period 5 gives:
30 letters per key position
The full cross-language result is:
| Plaintext language | Trials | English model | Spanish model | French model | German model |
|---|---|---|---|---|---|
| English | 39 | 36 | 1 | 2 | 9 |
| Spanish | 6 | 1 | 6 | 5 | 0 |
| French | 6 | 5 | 6 | 6 | 6 |
| German | 7 | 3 | 1 | 0 | 7 |
Values are exact recoveries of ORBIT, not percentages.
For the 19 non-English trials combined:
English model:
9 / 19 exact
47.4%
language-matched model:
19 / 19 exact
100.0%
The English model still recovers:
85.3%
of individual key letters across those same non-English trials.
That distinction is useful.
A key can be almost right while still failing exact recovery.
One wrong shift is enough to corrupt every fifth plaintext character.
Spanish shows the clearest model-mismatch failure
Take the first 150-letter Spanish held-out block.
Its normalized plaintext begins:
OLLEGABAALOSVEINTEYUNMOZO...
The true key is:
ORBIT
The Spanish model recovers:
ORBIT
The English model recovers:
ORBFT
Only one key letter is wrong.
But that one mistake changes every position controlled by the fourth column.
The English-model decryption begins:
OLLHGABADLOSVHINTEBUNMOCODO...
It is close enough to contain recognizable structure, yet wrong enough to fail exact plaintext recovery.
This is a common practical danger.
A mismatched model may not return obvious nonsense.
It may return a near-key that looks promising.
French demonstrates why language mismatch is not binary
The French 150-letter blocks behave differently.
The English model recovers:
5 / 6
exact keys.
The Spanish, French, and German models each recover:
6 / 6
in this small sample.
That does not mean all four languages have interchangeable distributions.
It means the correct Caesar shifts remained competitive enough under several models for these particular French blocks.
Frequency-based key recovery is an optimization problem.
A model can be imperfect and still choose the correct shift if:
the correct shift is clearly separated
the sample is favorable
the competing model is similar enough
So the right diagnostic question is not:
Is the language model exactly correct?
It is:
Is the model mismatch large enough to change the winning shift on the available sample?
300 letters can overcome some mismatch—but not all of it
At 300 ciphertext letters, each key position receives:
60 letters
The result is:
| Plaintext language | Trials | English model | Spanish model | French model | German model |
|---|---|---|---|---|---|
| English | 19 | 19 | 3 | 4 | 10 |
| Spanish | 3 | 0 | 3 | 3 | 0 |
| French | 3 | 3 | 3 | 3 | 3 |
| German | 3 | 3 | 0 | 0 | 3 |
For the nine non-English trials:
English model:
6 / 9 exact
66.7%
language-matched model:
9 / 9 exact
100.0%
The English model now succeeds on every French and German block.
It still fails on all three Spanish blocks.
More data has reduced some of the model error, but not eliminated it universally.
This is why “I have enough ciphertext” and “I have the right language model” are separate questions.
The language also changes the expected IC
Language assumptions enter period analysis even before chi-squared recovery.
The 500-letter training samples have these ordinary IC values:
| Sample | IC |
|---|---|
| English | 0.06422 |
| Spanish | 0.07454 |
| French | 0.07700 |
| German | 0.06753 |
Again, these are sample-specific observations, not canonical constants.
But they show why an English threshold should not be treated as universal.
The familiar heuristic:
English-like IC ≈ 0.065
random A–Z IC ≈ 1/26 ≈ 0.0385
is useful for English.
A different language or normalization policy can have a different coincidence level.
Average-column IC can still reveal periodic structure because the correct split produces more language-like columns, but interpreting the absolute height of those peaks requires more care.
The same warning applies even more strongly to a Friedman calculation that inserts a fixed language IC constant into its key-length estimate.
If the language is unknown, do not guess once and commit
A practical cracker does not need to know the language with certainty before doing anything.
A safer workflow is:
1. estimate plausible key periods with methods that do not require
one fixed monogram language model;
2. for each plausible period, try several language models;
3. recover a candidate key under each model;
4. reconstruct complete candidate plaintexts;
5. score those plaintexts with language-specific sequence models,
dictionaries, or language-identification evidence;
6. inspect the strongest candidates rather than trusting one
English-frequency result automatically.
This turns language into another hypothesis.
For example:
period 5 + English model
period 5 + Spanish model
period 5 + French model
period 5 + German model
can produce four key candidates.
The strongest reconstructed plaintext then provides evidence about both:
the key
and
the language
The site’s n-gram scoring guide explains why full-sequence scoring can distinguish candidates that look similar at the single-letter level.
Do not compare raw scores from unrelated models carelessly
Suppose an English model and a French model use:
different training corpora
different smoothing
different n-gram order
different alphabets
A raw score of:
-10.8
from one model is not automatically comparable with:
-11.2
from the other.
The scales may be different.
For multilingual ranking, keep the modeling choices aligned as much as possible:
same alphabet
same n-gram order
same smoothing
similar training sizes
same score normalization
or calibrate each language model on held-out text before comparing them.
This is the same reproducibility principle that matters in monolingual cryptanalysis, but multilingual work makes the problem easier to notice.
Related languages can confuse monogram recovery
The Spanish and French models perform similarly on several blocks in this benchmark.
At 300 letters, the French model recovers all three Spanish keys.
That should not be read as:
French frequencies are a perfect Spanish model
It means the coarse A–Z monogram distributions are sometimes similar enough that both rank the correct Caesar shift first.
Monograms throw away:
word structure
letter order
accent information
morphology
A language-specific trigram or tetragram model would distinguish Spanish and French far more strongly than a 26-number frequency table.
This is another reason monogram statistics are best treated as a key-search tool rather than a complete language model.
Domain can matter even when the language is correct
A language-matched model can still be poorly matched to the actual plaintext.
Consider English text made mostly of:
software identifiers
chemical names
military abbreviations
personal names
short codes
Its letter distribution may differ substantially from general prose.
The same is true within Spanish, French, or German.
This benchmark gives each language an advantage:
training and test text come from the same literary work
although the exact training letters and test letters do not overlap.
That controls the experiment, but it is favorable to the matched models.
Real cryptanalysis may need a broader corpus or a domain-specific one.
The result therefore demonstrates the effect of language mismatch under a controlled setup; it does not establish universal recovery rates for those languages.
Alphabet choices can matter more than the frequency table
This article intentionally forces all plaintext into A–Z because it is testing standard 26-letter Vigenère.
Real languages contain symbols outside that set.
Spanish has:
ñ
accented vowels
French uses many accented letters and ligatures in ordinary writing.
German uses:
ä
ö
ü
ß
If those symbols are preserved as independent cipher symbols, the alphabet is no longer the same 26-symbol system.
The modulus, frequency model, key arithmetic, and test vectors must all change together.
If they are transliterated into A–Z, document the transliteration.
Cryptanalysis is only meaningful when the attacker models the same symbol system that the encryptor actually used.
A practical non-English Vigenère workflow
When the plaintext may not be English:
1. determine the cipher alphabet and normalization policy;
2. normalize the ciphertext consistently;
3. estimate candidate periods without assuming one English
frequency table too early;
4. split the ciphertext into recurring columns;
5. recover column shifts under several plausible language models;
6. retain near-best shifts when columns are short;
7. reconstruct full candidate plaintexts;
8. rank them with a language-appropriate sequence model;
9. reduce harmonic keys to their fundamental period;
10. verify by readable plaintext and re-encryption.
If the language is known, step 5 becomes simpler.
If it is unknown, language and key recovery can be treated as a joint model-selection problem.
What the benchmark actually establishes
The measured results apply directly to this setup:
alphabet:
A–Z
normalization:
diacritics stripped
ß → SS
training:
first 500 normalized letters per source
frequency smoothing:
add-0.5
cipher:
standard repeating-key Vigenère
known period:
5
key:
ORBIT
test lengths:
150 and 300 letters
key recovery:
independent chi-squared Caesar recovery per column
Under those conditions, the matched models recover every tested non-English key:
150 letters:
19 / 19
300 letters:
9 / 9
The English model recovers:
150 letters:
9 / 19
300 letters:
6 / 9
Those are controlled observations, not universal language benchmarks.
Change the source text, training corpus, normalization, key period, ciphertext length, or scoring method and the numbers can change.
The useful conclusion
English frequency tables are not part of the Vigenère cipher.
They are part of an English Vigenère attack.
That distinction is easy to miss because many textbook examples assume English silently.
For non-English ciphertext, the mathematics of the repeating key can remain identical while the statistical evidence changes underneath it.
A wrong language model may still recover the key.
A related language model may work surprisingly well.
More ciphertext may overcome some mismatch.
But none of those outcomes makes English frequencies universal.
The reliable approach is to make the language assumption explicit, keep normalization consistent, and test plausible language models rather than allowing one default frequency table to decide the key silently.
Written by Marcus Hale
Editorially reviewed by VigenereDecoder.com editorial team
