Let's start by considering which cipher letters should correspond to the most common letters E
and T
. According to your frequency analysis, the most likely candidates are O
, K
, T
and maybe D
and N
.
Now, E
is the fifth letter of the alphabet, so unless your keyword is very short, it's going to encrypt to some letter in the keyword (and if the keyword is very short, E
would likely encrypt to A
or B
, which doesn't seem likely in this case). So let's ignore E
for now.
However, T
is the twentieth letter in the alphabet, so unless your keyword has twenty or more (unique!) letters, T
will encrypt to one of the "left-over" letters. Thus, the encryption of T
will tell you how many letters in the range T
to Z
the keyword contains.
So let's consider the possibilities. We can rule out T
encrypting to K
entirely — that would require the keyword to contain nine letters in the range T
to Z
, but there are only seven letters in that range! The same goes for D
, and N
, while barely possible, doesn't seem plausible either. Even O
, at four positions before T
in the alphabet, seems rather unlikely, given that most of the letters after T
in the alphabet are fairly uncommon. So my guess would be that T
— and thus also every letter after it in the alphabet — encrypts to itself. Looking at your letter frequencies, that seems plausible.
That leaves O
and K
as plausible encryptions for E
; the other one of those then probably stands for A
, which would mean that both of them occur in the keyword (and, in particular, that one of them is the first letter in the keyword). Alternatively, K
might stand for O
, and D
or N
for A
.
What about P
, Q
, R
and S
, then? Well, there's no way Q
encrypts to itself — the frequency of Q
in English pretty much never exceeds that of U
. However, Q
(nominal freq. 0.095) might well encrypt to P
(ciphertext freq. 0.161); it certainly doesn't encrypt to Z
, F
or X
, which are the only less frequent letters in the ciphertext than P
. That means that one of Q
, R
and S
must occur in the key; the ciphertext frequency of S
(3.617) is far enough from its nominal frequency (6.327) that we might guess that it's in the key, which would give us the following partial cipher table:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
????????????????PQRTUVWXYZ key letters: S, (O/K)
We might also guess that P
(nominal freq. 1.929) encrypts to M
(ciphertext freq. 1.688) – it certainly can't encrypt to N
(freq. 8.039) or O
(freq. 10.772), unless your message is about peppy popping pepper pips or something. Could O
(n.f. 7.507) then encrypt to L
(c.f. 3.617)? Maybe, but K
(c.f. 10.611) seems more likely.
That would mean that E
encrypts to O
and that L
and N
also occur in the key. Which plaintext letters could they stand for? Well, looking at the frequency table, N
might stand for A
and L
for C
or D
. That gives us the following partial cipher table:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
N???O?????????KMPQRTUVWXYZ key letters: L, S
Presumably, L
and S
stand for C
and D
in either order, but it's hard to tell from the frequencies which. What letter could stand for B
, then? Well, E
looks like a plausible choice — the frequencies are pretty close, and E
is common enough to be likely to appear in the keyword. Guessing that L
might stand for C
, that makes the cipher table look like this:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
NELSO?????????KMPQRTUVWXYZ
Could the keyword be NELSO(N)
? If so, A
would stand for F
, B
for G
and so on:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
NELSOABCDFGHIJKMPQRTUVWXYZ
Looking at the frequencies, I see no obvious mismatches, so I'm going to guess that that's the solution. Of course, examining the actual ciphertext could either confirm or refute this, but based on the frequencies alone it looks plausible.