Frekvenční analýza (2009)

1.1 Substituční šifry

Substituční šifry používají nahrazení písmen otevřeného textu podle nějakého pravidla. V tomto projektu je použita monoalfabetická substituční šifra, kde se každý znakotevřeného textu nahradí příslušným znakem šifrovaného textu.

1.2 Kryptoanalýza

Kryptoanalýza je věda zabývající se metodami získávání obsahu šifrovaných informací bez znalosti tajného klíče. Jako jednu z těchto metod můžeme označit frekvenční analýzu. Postup je založen na znalosti jazyka, ve kterém je text před zašifrováním napsán. U většiny jazyků jsou známá nejvíce používaná písmena, dvojice a trojice písmen, písmena vyskytující se před nebo za určitým písmenem. S vytvořením analýzy četnosti zašifrovaného textu a porovnáním s analýzou příslušného jazyka jsme schopni postupně odkrývat text. Cílem je dešifrovat text a zjistit klíč.

2 Postup řešení

2.1 Zadání zašifrovaného textu

WIHZY WIQYN IQGPD XOZNW APIOX NIUIV JPLYI VJPMP IPUIX NYLXQ HDLEH LLEPD MPIPU PIOPR LGDZX IWHGL EHZCD XNJPI DWNRE LEPDM PIPLE PGHQL UPXUG PDXNY PKUPR LLXAP VZJXG JPYVZ HZDLE VZTQL IHZTP XIWDQ LPIVX NQAPR HNQPL EPDSN QLYVY ZLEXG YMVLE QNREZ XZQPZ QPWIY NIQGP DMHQL EPYVI PRLXI XOHOV IWRHG GPYTI NZZVZ TQMEV REWHY PYIVG GQEPM HQHAV TAPPO DWHZM VLEEH IYGDH ZDZPR CHGLE XNTEE PYVYE HJPHJ PIDGH ITPWN QLHRE PWIQY NIQGP DMHQL EVZHZ YAGXZ YPHZY EHYZP HIGDL MVRPL EPNQN HGHWX NZLXO ZPRCM EVRER HWPVZ JPIDN QPONG HQQEP QUPZL QXWNR EXOEP ILVWP RIHZV ZTXJP ITHIY PZOPZ RPQQU DVZTX ZLEPZ PVTEA XIQLE PYNIQ GPDQE HYHQW HGGQX ZRHGG PYYNY GPDHZ YVZLE PVIXU VZVXZ LEPIP MHQZX OVZPI AXDHZ DMEPI PLEPY NIQGP DQEHY PJPID LEVZT LEPDM HZLPY ANLLE PDHGQ XEHYH QPRIP LHZYL EPVIT IPHLP QLOPH IMHQL EHLQX WPAXY DMXNG YYVQR XJPIV LLEPD YVYZL LEVZC LEPDR XNGYA PHIVL VOHZD XZPOX NZYXN LHAXN LLEPU XLLPI QWIQU XLLPI MHQWI QYNIQ GPDQQ VQLPI ANLLE PDEHY ZLWPL OXIQP JPIHG DPHIQ VZOHR LWIQY NIQGP DUIPL PZYPY QEPYV YZLEH JPHQV QLPIA PRHNQ PEPIQ VQLPI HZYEP ITXXY OXIZX LEVZT ENQAH ZYMPI PHQNZ YNIQG PDVQE HQVLM HQUXQ QVAGP LXAPL EPYNI QGPDQ QENYY PIPYL XLEVZ CMEHL LEPZP VTEAX IQMXN GYQHD VOLEP UXLLP IQHII VJPYV ZLEPQ LIPPL LEPYN IQGPD QCZPM LEHLL EPUXL LPIQE HYHQW HGGQX ZLXXA NLLEP DEHYZ PJPIP JPZQP PZEVW LEVQA XDMHQ HZXLE PITXX YIPHQ XZOXI CPPUV ZTLEP UXLLP IQHMH DLEPD YVYZL MHZLY NYGPD WVKVZ TMVLE HREVG YGVCP LEHLM EPZWI HZYWI QYNIQ GPDMX CPNUX ZLEPY NGGTI HDLNP QYHDX NIQLX IDQLH ILQLE PIPMH QZXLE VZTHA XNLLE PRGXN YDQCD XNLQV YPLXQ NTTPQ LLEHL QLIHZ TPHZY WDQLP IVXNQ LEVZT QMXNG YQXXZ APEHU UPZVZ THGGX JPILE PRXNZ LIDWI YNIQG PDENW WPYHQ EPUVR CPYXN LEVQW XQLAX IVZTL VPOXI MXICH ZYWIQ YNIQG PDTXQ QVUPY HMHDE HUUVG DHQQE PMIPQ LGPYH QRIPH WVZTY NYGPD VZLXE VQEVT EREHV I

2.2 Určení četnosti písmen

Podle zásady použití frekvenční analýzy jsem zjistil četnosti písmen u zašifrovaného a anglického textu.

Šifrovaný text
PísmenoČetnost [abs.]
P179
L127
Q115
H103
E98
Z90
X86
Y84
V76
N61
D58
G55
W34
M33
T30
R29
U24
A23
O20
J17
C12
K2
S1
Anglický text
PísmenoČetnost [%]
e10,4144
t7,2936
a6,5174
o5,9630
n5,6451
l5,5809
s5,1576
r4,9756
h4,9289
d3,4984
l3,3149
u2,2513
c2,1734
m2,0212
f1,9788
w1,7127
g1,5861
y1,4598
p1,3765
b0,0861
v0,0784
k0,5053
x0,1369
j0,0903
q0,0861
z0,0784

2.3 Určení četností digramů a trigramů

Šifrovaný text
DigramČetnost [abs.]
LE54
EP44
PI34
IQ30
PD27
VZ25
QL23
HZ22
EH22
GP21
XN21
HQ21
PY20
LL18
Šifrovaný text
TrigramČetnost [abs.]
LEP32
GPD17
NIQ14
YNI13
IQG13
QGP13
VZT13
LLE12
HZY10
EPD10
LEV10
LPI10
PIP9
JPI9
Četnost digramů v anglickém textu
thheineranreonenatesedtetiorstarnd
Četnost zdvojených písmen v anglickém textu
lleessttoommffppnnccdd
Četnost trigramů v anglickém textu
theandtioatiforthaterreserecontedcomhatentionhasing

2.4 Identifikace nejčastěji se vyskytujících písmen a postupné odkrývání původního textu

2.4.1 Pokus č. 1

V šifrovaném textu jsou nevíce zastoupena písmena P, L, Q, v anglickém textu pak e, t, a. Předpokládal jsem tedy, že

P > eL > tQ > a

Tuto hypotézu mi, alespoň z části, potvrdily di- a trigramy. Nejvíce zastoupené digramy jsou LE, EP, PI, v anglické textu pak th, he, in, er, re.

LE > thEP > hePI > erPD > en

Nejvíce zastoupený trigram je LEP, z předchozího vyplývá, že se jedná o the.

LEP > the
Klíč
abcdefghijklmnopqrstuvwxyz
Q P ER D L
Dešifrovaný text podle části klíče
----- --a-- -a-en ----- -e--- ----- -et-- --e-e -e--- --t-a -nth- tthen -e-e- e--ei
t-n-- ----t h---n ---e- n--ih then- e-eth e--at -e--- en--- e--ei tt--e ----- -e---
--nth ---at ----e ---na te--- -a-ei --aet hen-- at--- -th-- ---th a-ih- --ae- ae---
--a-e n--at he--- eit-- ----- --i-- -e--- ----- -a-h- ih--- e---- -ahe- -a--- --ee
n---- -thh- ---n- -n-ei ---th ---hh e---h --e-- e-n-- --e-- at-ih e--a- --a-e n--at
h---- ----- -e--- h---e ---nt --iet he-a- ----- --t-- -ei-- h-ihi --e-- -e-n- ae---
-aahe a-e-t a---i h--he -t--e i---- ----e ----- e--e- ieaa- n---- -the- e--h- --ath
e---a -enah ---a- ---a- -i--- e---- -en-- ---th e---- ----- the-e --a-- ---e- --n--
n-he- ethe- --a-e nah-- e-e-n th--- then- --te- --tth en--a -h--- aei-e t---t he---
-e-te at-e- ---at h-ta- -e--- n---- ---ai --e-- tthen ----t th--- theni ----- e---t
----n --e-- ----- t---- tthe- -tte- a--a- -tte- --a-- a---a -enaa -ate- --tth enh--
-t-et ---ae -e--- ne--a ----i t--a- --a-e n--et e--e- ahe-- --th- -e-a- ate-- ei--a
ehe-a -ate- ---he ----- ----- th--- h-a-- ---e- e-a-- ---a- en-ah -a-t- -a--a a---e
t--et he--- a-ena ah--- e-e-t -th-- --h-t the-e --h-- -a--- --a-n --the --tte -a---
--e-- -thea t-eet the-- -a-en a--e- th-tt he--t te-ah ---a- ---a- -t--- -tthe nh---
e-e-e -e-ae e-h-- th-a- -n--a ---th e---- --e-a ----- -ee-- --the --tte -a--- nthen
----t ---t- ---en ----- ---th -ih-- ----e th-t- he--- ----- a---a -en-- -e--- -the-
----- -nt-e a--n- --at- -nat- -tath e-e-- a--th ----- --tth ei--- -na-n --ta- -et-a
---ea tth-t at--- -e--- -nate ----a th--- a---- -a--- -eh-- -e--- ----- -e-th ei---
t-n-- ---a- enh-- -e--a he--i -e--- th-a- -at-- ----t -e--- ----- ----a ---a- en--a
a--e- ---nh ----- n-aah e--ea t-e-- ai-e- ----- ---en --t-h -ah-- hih-- -

2.4.2 Pokus č. 2

V předchozím pokusu jsem nebyl schopen identifikovat žádné slovo. Začínám tedy od začátku s jinou úvahou. Z minulého pokusu jsem použil

P > eL > tE > h

Pokusil jsem se najít velmi často vyskytovaný trigram v anglickém jazyce: and. Část tří písmen, kterou jsem hledal, nesměla obsahovat P, L ani E. Často se vyskytuje také ing, druhé písmeno je n jako u and. Hledal jsem tedy často vyskytující se trigram v šifře, který má jako druhý znak stejné písmeno.

Pokusu vyhovovaly VZT a HZY. Jeden z nich bude nejspíše and, druhý ing. Jak zjistit který je který? Použil jsem podobný mechanismus. Zkusil jsem nalézt trigram tha, který se také často vyskytuje, navíc písmena t a h znám. Hledal jsem tedy tří-písmennou kombinaci, která začíná na LE.

Pokusu vyhovovaly trigramy LEV a LEH. Výsledek ale nebyl jednoznačný, proto jsem zkusil obě možnosti dosadit v následujících dvou experimentech.

2.4.3 Pokus č. 3 A

Pokus č. 3 A bezprostředně navazuje na Pokus č. 2, kde jsem určil dvě možnosti, jak může být text zašifrován. Zde je první z nich. V tomto experimentu jsem považoval za správné:

P > eL > tE > h
T > andHZY > ingLEV > tha

Zkusil jsem dešifrovat text s výše uvedeným výsledkem.

Klíč
abcdefghijklmnopqrstuvwxyz
V TP YEH Z L
Dešifrovaný text podle části klíče
--ing ---g- ---e- --n-- -e--- ----a -etg- a-e-e -e--- -gt-- i-thi tthe- -e-e- e--e-
t--n- --i-t hin-- ---e- ----h the-- e-eth e-i-t -e--- e---g e--e- tt--e an--- -egan
in-th and-t -inde ----- te-a- ---e- i--et he--- -tgag nth-- g-ath ---hn -n-en -e--g
----e --i-t hega- e-t-- --i-a ---i- -egd- -nnan d--ha -h-ig eg-a- --he- i-i-a d-ee-
--in- athhi -g--i n-ne- -i-th --dhh egagh i-ei- e---i -de-- -ti-h e---g ----e --i-t
hanin g---n geing higne i---t -a-et he--- i-i-- -nt-- ne--- ha-h- i-ean -e--- -e---
i--he --ent ----- h--he -ta-e --ina nd--e -di-g en-en -e--- -and- nthen eadh- ---th
eg--- -e--h igi-- i---- n-i-- egg-g -e-in ganth ea--- ana-n the-e -i-n- -ane- ---in
--he- etheg ----e --hig e-e-- thand the-- integ --tth e-i-- -higi -e--e tingt hea-d
-eite -t-ei --i-t hit-- -e--g ----- gga-- --e-a tthe- gagnt than- the-- ---g- ei-at
a-in- -ne-- -ng-- ti--- tthe- -tte- ----- -tte- -i--- -g--- -e--- a-te- --tth e-hig
nt-et ----e -e-i- -ei-- an-i- t---g ----e ---et engeg -hega gnthi -ei-a -te-- e-i--
ehe-- a-te- inghe -d--g ---n- thand h---i ng-e- ei--n g---- e-a-h i-at- i---- -a--e
t--et heg-- --e-- -h-gg e-egt -than --hit thene adh-- ----- -g-i- a-the --tte --i--
a-ega nthe- t-eet theg- ---e- --ne- thitt he--t te--h igi-- i---- nt--- -tthe -hign
e-e-e -en-e enha- tha-- ---i- in-th e-d-- g-ei- -n--- -ee-a ndthe --tte --i-i -the-
gagnt -intg -g-e- -a-an d-ath i-ha- g-a-e thit- hen-- ing-- -g--- -e--- -e--- ntheg
---d- i-t-e -gi-- ---t- ---ti -t-th e-e-i -n-th andi- --tth e---- g---- --t-a get--
-dde- tthit -t-in deing ---te -a--- thand ----- g---n -ehi- -enan di--- -e-th e---n
t---- g---- e-h-- -egi- he-a- -eg-- tha-- --t-- -andt ae--- ----i ng--- g---- e-d--
-a-eg i-i-h i--a- -i--h e--e- t-egi ---ei -andg -g-e- ant-h a-had h-hia -

2.4.4 Pokus č. 3 B

V tomto pokusu považuji za správné:

P > eL > tE > h
VZT > ingHZY > andLEH > tha

Zkusil jsem dešifrovat text s výše uvedeným výsledkem.

Klíč
abcdefghijklmnopqrstuvwxyz
H YP TEV Z L
Dešifrovaný text podle části klíče
--and ---d- ---e- --n-- -e--- ----i -etd- i-e-e -e--- -dt-- a-tha tthe- -e-e- e--e-
t--n- --a-t han-- ---e- ----h the-- e-eth e-a-t -e--- e---d e--e- tt--e in--- -edin
an-th ing-t -ange ----- te-i- ---e- a--et he--- -tdid nth-- d-ith ---hn -n-en -e--d
----e --a-t hedi- e-t-- --a-i ---a- -edg- -nnin g--hi -h-ad ed-i- --he- a-a-i g-ee-
--an- ithha -d--a n-ne- -a-th --ghh edidh a-ea- e---a -ge-- -ta-h e---d ----e --a-t
hinan d---n deand hadne a---t -i-et he--- a-a-- -nt-- ne--- hi-h- a-ein -e--- -e---
a--he --ent ----- h--he -ti-e --ani ng--e -ga-d en-en -e--- -ing- nthen eigh- ---th
ed--- -e--h ada-- a---- n-a-- edd-d -e-an dinth ei--- ini-n the-e -a-n- -ine- ---an
--he- ethed ----e --had e-e-- thing the-- anted --tth e-a-- -hada -e--e tandt hei-g
-eate -t-ea --a-t hat-- -e--d ----- ddi-- --e-i tthe- didnt thin- the-- ---d- ea-it
i-an- -ne-- -nd-- ta--- tthe- -tte- ----- -tte- -a--- -d--- -e--- i-te- --tth e-had
nt-et ----e -e-a- -ea-- in-a- t---d ----e ---et ended -hedi dntha -ea-i -te-- e-a--
ehe-- i-te- andhe -g--d ---n- thing h---a nd-e- ea--n d---- e-i-h a-it- a---- -i--e
t--et hed-- --e-- -h-dd e-edt -thin --hat thene igh-- ----- -d-a- i-the --tte --a--
i-edi nthe- t-eet thed- ---e- --ne- thatt he--t te--h ada-- a---- nt--- -tthe -hadn
e-e-e -en-e enhi- thi-- ---a- an-th e-g-- d-ea- -n--- -ee-i ngthe --tte --a-a -the-
didnt -antd -d-e- -i-in g-ith a-hi- d-i-e that- hen-- and-- -d--- -e--- -e--- nthed
---g- a-t-e -da-- ---t- ---ta -t-th e-e-a -n-th inga- --tth e---- d---- --t-i det--
-gge- tthat -t-an geand ---te -i--- thing ----- d---n -eha- -enin ga--- -e-th e---n
t---- d---- e-h-- -eda- he-i- -ed-- thi-- --t-- -ingt ie--- ----a nd--- d---- e-g--
-i-ed a-a-h a--i- -a--h e--e- t-eda ---ea -ingd -d-e- int-h i-hig h-hai -

2.4.5 Určování písmen v dešifrovaném textu

V dešifrovaném textu podle Pokusu č. 3 B jsem našel na řádku č. 3 slovo an-ything, proto jsem dosadil

D > y

a předpokládal jsem, že varianta 3 B je správná.

Klíč
abcdefghijklmnopqrstuvwxyz
H YP TEV Z L D
Dešifrovaný text podle části klíče
--and ---d- ---ey --n-- -e--- ----i -etd- i-e-e -e--- -dt-- aytha tthey -e-e- e--e-
t-yn- --a-t han-y ---e- y---h they- e-eth e-a-t -e--- ey--d e--e- tt--e in--- -edin
anyth ing-t -ange ---y- te-i- ---e- a--et hey-- -tdid nth-- d-ith ---hn -n-en -e--d
----e y-a-t hedi- e-t-- --a-i ---a- -edg- -nnin g--hi -h-ad ed-i- --he- a-a-i g-ee-
y-an- ithha -d-ya nyne- -a-th --ghh edidh a-ea- e-y-a -ge-- -ta-h e---d ----e y-a-t
hinan d---n deand hadne a--yt -i-et he--- a-a-- -nt-- ne--- hi-h- a-ein -e-y- -e---
a--he --ent ----- h--he -ti-e --ani ng--e -ga-d en-en -e--- ying- nthen eigh- ---th
ed--- -ey-h ada-- a---- n-a-- edd-d -eyan dinth ei--- ini-n the-e -a-n- -ine- --yan
y-he- ethed ----e y-had e-e-y thing they- anted --tth eya-- -hada -e--e tandt hei-g
-eate -t-ea --a-t hat-- -e--d y---- ddi-- --e-i tthey didnt thin- they- ---d- ea-it
i-any -ne-- -nd-- ta--- tthe- -tte- ----- -tte- -a--- -d--- -ey-- i-te- --tth eyhad
nt-et ----e -e-a- yea-- in-a- t---d ----e y--et ended -hedi dntha -ea-i -te-- e-a--
ehe-- i-te- andhe -g--d ---n- thing h---a nd-e- ea--n d---- eyi-h a-it- a---- -i--e
t--et hed-- --ey- -h-dd e-edt -thin --hat thene igh-- ----- -d-ay i-the --tte --a--
i-edi nthe- t-eet thed- ---ey --ne- thatt he--t te--h ada-- a---- nt--- -tthe yhadn
e-e-e -en-e enhi- thi-- -y-a- an-th e-g-- d-ea- -n--- -ee-i ngthe --tte --a-a ythey
didnt -antd -d-ey -i-in g-ith a-hi- d-i-e that- hen-- and-- -d--- -ey-- -e--- nthed
---g- ayt-e -day- ---t- -y-ta -t-th e-e-a -n-th inga- --tth e---- dy--y --t-i det--
-gge- tthat -t-an geand -y-te -i--- thing ----- d---n -eha- -enin ga--- -e-th e---n
t-y-- d---- eyh-- -eda- he-i- -ed-- thi-- --t-- -ingt ie--- ----a nd--- d---- eyg--
-i-ed a-ayh a--i- ya--h e--e- t-eda ---ea -ingd -d-ey int-h i-hig h-hai -

2.4.6 Určování dalších písmen

Dále jsem pokračoval v hledání slov, které dokážu určit.

10. řádekthey didnt thin- theyC > k
12. řádekhe didnt ha-eJ > v
Klíč
abcdefghijklmnopqrstuvwxyz
H YP TEV C Z L J D
Dešifrovaný text podle části klíče
--and ---d- ---ey --n-- -e--- ----i vetd- ive-e -e--- -dt-- aytha tthey -e-e- e--e-
t-yn- --a-t hanky --ve- y---h they- e-eth e-a-t -e--- ey--d e--e- tt--e inv-- vedin
anyth ing-t -ange ---y- te-i- ---e- a--et hey-- -tdid nth-- d-ith ---hn -n-en -e--d
----e y-a-t hedi- e-t-- --a-i ---a- -edg- -nnin g--hi -h-ad ed-i- --he- a-a-i g-ee-
y-an- ithha -d-ya nyne- ka-th --ghh edidh aveav e-y-a -ge-- -ta-h e---d ----e y-a-t
hinan d---n deand hadne a--yt -i-et he--- a-a-- -nt-- ne-k- hi-h- a-ein ve-y- -e---
a--he --ent ----- h--he -ti-e --ani ng-ve -ga-d en-en -e--- ying- nthen eigh- ---th
ed--- -ey-h ada-- a---- n-a-- edd-d -eyan dinth ei--- ini-n the-e -a-n- -ine- --yan
y-he- ethed ----e y-had eve-y thing they- anted --tth eya-- -hada -e--e tandt hei-g
-eate -t-ea --a-t hat-- -e--d y---- ddi-- -ve-i tthey didnt think they- ---d- ea-it
i-any -ne-- -nd-- ta--- tthe- -tte- ----- -tte- -a--- -d--- -ey-- i-te- --tth eyhad
nt-et ----e ve-a- yea-- in-a- t---d ----e y--et ended -hedi dntha vea-i -te-- e-a--
ehe-- i-te- andhe -g--d ---n- thing h---a nd-e- ea--n d---- eyi-h a-it- a---- -i--e
t--et hed-- --ey- -h-dd e-edt -thin k-hat thene igh-- ----- -d-ay i-the --tte --a--
ivedi nthe- t-eet thed- ---ey -kne- thatt he--t te--h ada-- a---- nt--- -tthe yhadn
eve-e ven-e enhi- thi-- -y-a- an-th e-g-- d-ea- -n--- kee-i ngthe --tte --a-a ythey
didnt -antd -d-ey -i-in g-ith a-hi- d-ike that- hen-- and-- -d--- -ey-- ke--- nthed
---g- ayt-e -day- ---t- -y-ta -t-th e-e-a -n-th inga- --tth e---- dy-ky --t-i det--
-gge- tthat -t-an geand -y-te -i--- thing ----- d---n -eha- -enin ga--- ve-th e---n
t-y-- d---- eyh-- -eda- he-i- ked-- thi-- --t-- -ingt ie--- ---ka nd--- d---- eyg--
-i-ed a-ayh a--i- ya--h e--e- t-eda ---ea -ingd -d-ey int-h i-hig h-hai -
16. řádekthey didnt -antM > w
17. řádek-ike thatG > l
13. řádekand he- g--dI > r   X > o
Klíč
abcdefghijklmnopqrstuvwxyz
H YP TEV CG ZX I L JM D
Dešifrovaný text podle části klíče
-rand -r-d- r-ley o-n-- -er-o -r-ri vetdr ivewe re-ro -dto- aytha tthey were- er-e-
tlyno r-alt hanky o-ver y---h theyw ereth ela-t -eo-l eyo-d e--e- tto-e invol vedin
anyth ing-t range or-y- terio ---e- a--et hey-- -tdid nthol dwith ---hn on-en -e-rd
-r-le ywa-t hedir e-tor o-a-i r--al ledgr -nnin g-whi -h-ad edril l-hew a-a-i g-ee-
y-anw ithha rdlya nyne- kalth o-ghh edidh aveav eryla rge-- -ta-h e-r-d -r-le ywa-t
hinan d-lon deand hadne arlyt wi-et he--- ala-o -nto- ne-kw hi-h- a-ein very- -e--l
a--he --ent -o--- ho-he rti-e -rani ngove rgard en-en -e--- yingo nthen eigh- or-th
ed-r- ley-h ada-- all-o n-all edd-d leyan dinth eiro- inion there wa-no -iner -oyan
ywher ethed -r-le y-had every thing theyw anted --tth eyal- ohada -e-re tandt heirg
reate -t-ea rwa-t hat-o -e-od ywo-l ddi-- overi tthey didnt think they- o-ld- earit
i-any one-o -ndo- ta-o- tthe- otter --r-- otter wa--r -d-r- ley-- i-ter --tth eyhad
nt-et -or-e veral year- in-a- t-r-d -r-le y-ret ended -hedi dntha vea-i -ter- e-a--
eher- i-ter andhe rgood -orno thing h---a ndwer ea--n d-r-l eyi-h a-itw a--o- -i-le
to-et hed-r -ley- -h-dd eredt othin kwhat thene igh-o r-wo- ld-ay i-the -otte r-arr
ivedi nthe- treet thed- r-ley -knew thatt he-ot ter-h ada-- all-o ntoo- -tthe yhadn
evere ven-e enhi- thi-- oywa- anoth ergoo drea- on-or kee-i ngthe -otte r-awa ythey
didnt wantd -dley -i-in gwith a-hil dlike thatw hen-r and-r -d-r- leywo ke--o nthed
-llgr ayt-e -dayo -r-to ry-ta rt-th erewa -noth inga- o-tth e-lo- dy-ky o-t-i deto-
-gge- tthat -tran geand -y-te rio-- thing -wo-l d-oon -eha- -enin gallo verth e-o-n
try-r d-r-l eyh-- -eda- he-i- kedo- thi-- o-t-o ringt ie-or worka nd-r- d-r-l eygo-
-i-ed awayh a--il ya--h ewre- tleda --rea -ingd -dley intoh i-hig h-hai r

Po určení několika dalších písmen z šifry jsem se pokusl hledat písmeno s. Často se vyskytuje v anglickém textu jako samostatné písmeno, v digramu zdvojeně (ss) a také jako es se st ts. Nejčastěji zdvojené v šifrovaném textu je LL, GG a QQ. L a G znám, jsou to t a l. Q neznám, může to být s. Potvrzuje to i použití PQ a QL, LQ a QL.

Q > s

Posléze jsem hledal slovo some. Písmena o, m a e znám, v textu jsem hledal QX-P (so-e). Byl jsem úspěšný, proto:

W > m
Klíč
abcdefghijklmnopqrstuvwxyz
H YP TEV CG ZX I L JM D
Dešifrovaný text podle části klíče
mrand mrsd- rsley o-n-m -er-o -r-ri vetdr ive-e re-ro -dtos aytha tthey -ere- er-e-
tlyno rmalt hanky o-ver ym--h they- ereth elast -eo-l eyo-d e--e- tto-e invol vedin
anyth ingst range ormys terio -s-e- a-set hey-- stdid nthol d-ith s--hn onsen semrd
-rsle y-ast hedir e-tor o-a-i rm-al ledgr -nnin gs-hi -hmad edril lshe- asa-i g-ee-
yman- ithha rdlya nyne- kalth o-ghh edidh aveav eryla rgem- sta-h emrsd -rsle y-ast
hinan d-lon deand hadne arlyt -i-et he-s- alamo -nto- ne-k- hi-h- amein very- se--l
asshe s-ent som-- ho-he rtime -rani ngove rgard en-en -ess- yingo nthen eigh- orsth
ed-rs leysh adasm allso n-all edd-d leyan dinth eiro- inion there -asno -iner -oyan
y-her ethed -rsle yshad every thing they- anted --tth eyals ohada se-re tandt heirg
reate st-ea r-ast hatso me-od y-o-l ddis- overi tthey didnt think they- o-ld- earit
i-any one-o -ndo- ta-o- tthe- otter smrs- otter -asmr sd-rs leyss ister --tth eyhad
ntmet -orse veral years in-a- tmrsd -rsle y-ret ended shedi dntha veasi ster- e-a-s
ehers ister andhe rgood -orno thing h-s-a nd-er eas-n d-rsl eyish asit- as-os si-le
to-et hed-r sleys sh-dd eredt othin k-hat thene igh-o rs-o- ldsay i-the -otte rsarr
ivedi nthes treet thed- rsley skne- thatt he-ot tersh adasm allso ntoo- -tthe yhadn
evere vense enhim this- oy-as anoth ergoo dreas on-or kee-i ngthe -otte rsa-a ythey
didnt -antd -dley mi-in g-ith a-hil dlike that- henmr andmr sd-rs ley-o ke--o nthed
-llgr ayt-e sdayo -rsto rysta rtsth ere-a snoth inga- o-tth e-lo- dysky o-tsi detos
-gges tthat stran geand myste rio-s thing s-o-l dsoon -eha- -enin gallo verth e-o-n
trymr d-rsl eyh-m medas he-i- kedo- thism ost-o ringt ie-or -orka ndmrs d-rsl eygos
si-ed a-ayh a--il yassh e-res tleda s-rea mingd -dley intoh ishig h-hai r

Na prvím řádku jsem byl schopen rozluštit část první věty:

Mr and Mrs D-rsley

Slovo D-rsley mi bylo povědomé, předpokládal jsem, že se jedná o příjmení, proto tedy:

N > u

Po zjištění prvních slov šifry jsem zkusil hledat tento text ve vyhledávači Google. Zjistil jsem, že šifra odpovídá části první kapitoly knihy Harry Potter and The Sorcerer's Stone (Harry Potter a kámen mudrců) od J. K. Rowling.

Pátrání bylo u konce. Na závěr jsem doplnil všechna další nerozluštěná písmenka, sestavil úplný klíč a dešifroval celý text.

A > bR > cO > fS > j
U > pN > uM > wK > x

2.5 Dešifrování zprávy a zjištění použitého klíče

2.5.1 Podrobný přehled

Šifrovaný text
WIHZY WIQYN IQGPD XOZNW APIOX NIUIV JPLYI VJPMP IPUIX NYLXQ HDLEH LLEPD MPIPU PIOPR
LGDZX IWHGL EHZCD XNJPI DWNRE LEPDM PIPLE PGHQL UPXUG PDXNY PKUPR LLXAP VZJXG JPYVZ
HZDLE VZTQL IHZTP XIWDQ LPIVX NQAPR HNQPL EPDSN QLYVY ZLEXG YMVLE QNREZ XZQPZ QPWIY
NIQGP DMHQL EPYVI PRLXI XOHOV IWRHG GPYTI NZZVZ TQMEV REWHY PYIVG GQEPM HQHAV TAPPO
DWHZM VLEEH IYGDH ZDZPR CHGLE XNTEE PYVYE HJPHJ PIDGH ITPWN QLHRE PWIQY NIQGP DMHQL
EVZHZ YAGXZ YPHZY EHYZP HIGDL MVRPL EPNQN HGHWX NZLXO ZPRCM EVRER HWPVZ JPIDN QPONG
HQQEP QUPZL QXWNR EXOEP ILVWP RIHZV ZTXJP ITHIY PZOPZ RPQQU DVZTX ZLEPZ PVTEA XIQLE
PYNIQ GPDQE HYHQW HGGQX ZRHGG PYYNY GPDHZ YVZLE PVIXU VZVXZ LEPIP MHQZX OVZPI AXDHZ
DMEPI PLEPY NIQGP DQEHY PJPID LEVZT LEPDM HZLPY ANLLE PDHGQ XEHYH QPRIP LHZYL EPVIT
IPHLP QLOPH IMHQL EHLQX WPAXY DMXNG YYVQR XJPIV LLEPD YVYZL LEVZC LEPDR XNGYA PHIVL
VOHZD XZPOX NZYXN LHAXN LLEPU XLLPI QWIQU XLLPI MHQWI QYNIQ GPDQQ VQLPI ANLLE PDEHY
ZLWPL OXIQP JPIHG DPHIQ VZOHR LWIQY NIQGP DUIPL PZYPY QEPYV YZLEH JPHQV QLPIA PRHNQ
PEPIQ VQLPI HZYEP ITXXY OXIZX LEVZT ENQAH ZYMPI PHQNZ YNIQG PDVQE HQVLM HQUXQ QVAGP
LXAPL EPYNI QGPDQ QENYY PIPYL XLEVZ CMEHL LEPZP VTEAX IQMXN GYQHD VOLEP UXLLP IQHII
VJPYV ZLEPQ LIPPL LEPYN IQGPD QCZPM LEHLL EPUXL LPIQE HYHQW HGGQX ZLXXA NLLEP DEHYZ
PJPIP JPZQP PZEVW LEVQA XDMHQ HZXLE PITXX YIPHQ XZOXI CPPUV ZTLEP UXLLP IQHMH DLEPD
YVYZL MHZLY NYGPD WVKVZ TMVLE HREVG YGVCP LEHLM EPZWI HZYWI QYNIQ GPDMX CPNUX ZLEPY
NGGTI HDLNP QYHDX NIQLX IDQLH ILQLE PIPMH QZXLE VZTHA XNLLE PRGXN YDQCD XNLQV YPLXQ
NTTPQ LLEHL QLIHZ TPHZY WDQLP IVXNQ LEVZT QMXNG YQXXZ APEHU UPZVZ THGGX JPILE PRXNZ
LIDWI YNIQG PDENW WPYHQ EPUVR CPYXN LEVQW XQLAX IVZTL VPOXI MXICH ZYWIQ YNIQG PDTXQ
QVUPY HMHDE HUUVG DHQQE PMIPQ LGPYH QRIPH WVZTY NYGPD VZLXE VQEVT EREHV I
Klíč
abcdefghijklmnopqrstuvwxyz
HARYPOTEVSCGWZXU IQLNJMKD
Dešifrovaný text podle části klíče
mrand mrsdu rsley ofnum berfo urpri vetdr ivewe repro udtos aytha tthey werep erfec
tlyno rmalt hanky ouver ymuch theyw ereth elast peopl eyoud expec ttobe invol vedin
anyth ingst range ormys terio usbec auset heyju stdid nthol dwith suchn onsen semrd
ursle ywast hedir ector ofafi rmcal ledgr unnin gswhi chmad edril lshew asabi gbeef
ymanw ithha rdlya nynec kalth oughh edidh aveav eryla rgemu stach emrsd ursle ywast
hinan dblon deand hadne arlyt wicet heusu alamo untof neckw hichc amein veryu seful
asshe spent somuc hofhe rtime crani ngove rgard enfen cessp yingo nthen eighb orsth
edurs leysh adasm allso ncall eddud leyan dinth eirop inion there wasno finer boyan
ywher ethed ursle yshad every thing theyw anted butth eyals ohada secre tandt heirg
reate stfea rwast hatso mebod ywoul ddisc overi tthey didnt think theyc ouldb earit
ifany onefo undou tabou tthep otter smrsp otter wasmr sdurs leyss ister butth eyhad
ntmet forse veral years infac tmrsd ursle ypret ended shedi dntha veasi sterb ecaus
ehers ister andhe rgood forno thing husba ndwer easun dursl eyish asitw aspos sible
tobet hedur sleys shudd eredt othin kwhat thene ighbo rswou ldsay ifthe potte rsarr
ivedi nthes treet thedu rsley sknew thatt hepot tersh adasm allso ntoob utthe yhadn
evere vense enhim thisb oywas anoth ergoo dreas onfor keepi ngthe potte rsawa ythey
didnt wantd udley mixin gwith achil dlike thatw henmr andmr sdurs leywo keupo nthed
ullgr aytue sdayo ursto rysta rtsth erewa snoth ingab outth eclou dysky outsi detos
ugges tthat stran geand myste rious thing swoul dsoon behap penin gallo verth ecoun
trymr dursl eyhum medas hepic kedou thism ostbo ringt iefor worka ndmrs dursl eygos
siped awayh appil yassh ewres tleda screa mingd udley intoh ishig hchai r

2.5.2 Upravený dešifrovaný text

Mr and Mrs Dursley, of number four, Privet Drive, were proud to say that they were perfectly normal, thank you very much. They were the last people you'd expect to be involved in anything strange or mysterious, because they just didn't hold with such nonsense.

Mr Dursley was the director of a firm called Grunnings, which made drills. He was a big, beefy man with hardly any neck, although he did have a very large moustache. Mrs Dursley was thin, blond and had nearly twice the usual amount of neck, which came in very useful as she spent so much of her time craning over garden fences, spying on the neighbours. The Dursleys had a small son called Dudley and in their opinion there was no finer boy anywhere.

The Dursleys had everything they wanted, but they also had a secret, and their greatest fear was that somebody would discover it. They didn't think they could bear it if anyone found out about the Potters. Mrs Potter was Mrs Dursley sister, but they hadn't met for several years; in fact Mrs Dursley pretended she didn't have a sister, because her sister and her good-for-nothing husband were as unDursleyish as it was possible to be. The Dursleys shuddered to think what the neighbors would say if the Potters arrived in the street. The Dursleys knew that the Potters had two twin boys, but they had never even seen them. These boys were another good reason for keeping the Potters away; they didn't want Dudley mixing with children like that.

When Mr and Mrs Dursley woke up on the dull, grey Tuesday our story starts, there was nothing about the cloudy sky to suggest that strange and mysterious things would soon be happening all over the country. Mr Dursley hummed as he picked out his most boring tie for work and Mrs Dursley gossiped away happily as she wrestled a screaming Dudley into his highchair.

3 Závěr

Ve své práci jsem se zabýval dešifrováním textu pomocí frekvenční analýzy. Práce to byla nesnadná a zejména v začátcích, kdy se ještě nedalo na ničem stavět, jsem si nebyl jistý úspěchem. Po dvou náročných dnech a nocích jsem se dostal do sladkého finiše, který pro mne představoval rozluštění celé zprávy. Nejlépe jsem se bavil v poslední fázi dešifrování, kde už byl kladný výsledek na dohled.

4 Zdroje