Parity in the Kryptos alphabet
When using the Vigenère table, English plaintext gets converted to an index using the KRYPTOS alphabet order. I found a statistical aberration in that. If you look at the English frequencies of even and odd letters they are very lopsided:
KYTSBDFHJMQVX = 35%, TSHDmfybvkjxq (even index: 0,2,4,6,...24)
RPOACEGILNUWZ = 65%, EAOINRLcugpwz (odd index: 1,3,5,7,...25)
This bias is about double the bias of the English alphabet, and in the opposite direction.
PALIMPSEST fits the pattern with 6/10: 1111010100
ABSCISSA is slightly low with 4/8 (expected 5): 10011001
The letters in every Nth letter of a Quagmire III with Kryptos alphabet should all have this bias, so the expected absolute distance from 50% gives a value of about 15%. From this we can derive a score which is a bit of a Kryptos fingerprint (+0.3).
def kryptos_parity_range(text:str, period:int=1):
return [(np.mean([k in 'RPOACEGILNUWZ' for k in text[i::period]])*2-1) for i in range(period)]
def kryptos_parity_score(text:str, period:int):
return np.mean(np.abs(kryptos_parity_range(text, period)))
def kryptos_parity_majority(text:str, period:int):
return np.int32(np.clip(kryptos_parity_range(text, period),-0.1,0.1)/0.1)
Some usage:
kryptos_parity_score(K1, 10) # =0.42 = 0.3+0.12
kryptos_parity_score(K2, 8) # =0.20 = 0.3-0.10
kryptos_parity_majority('PALIMPSEST',10)
array([ 1, 1, 1, 1, -1, 1, -1, 1, -1, -1])
kryptos_parity_majority(K1,10)
array([-1, -1, -1, 0, -1, -1, 1, -1, 1, 0])
YES YES YES ? NO YES YES YES YES ? <- key and cipher have opposite parity
kryptos_parity_majority('ABSCISSA',8)
array([ 1, -1, -1, 1, 1, -1, -1, 1])
kryptos_parity_majority(K2,8)
array([-1, 1, 1, -1, 0, -1, 0, -1])
YES YES YES YES ? NO ? YES <- key and cipher have opposite parity
With high probability, knowing only the period of the key, you can read the parity directly from the ciphertext. The kryptos_parity_range will be +0.3 for plaintext, and negative for single layer Quagmire (assuming the key is majority-odd), even with the period set to 1.
K4 has no obvious period. It reports a small positive number +0.03 for every period. That could match a running key, for example.