Classic Crypto Challenge 1: Subtitution

Pada tulisan hari ini akan dibahas mengenai classic crypto challenge pertama, cara dekrip cipher mono-alphabetical maupun poly-alphabetical.

Challenge

Seseorang telah mengenkripsi sebuah artikel dalam bahasa Inggris menjadi cipherteks dengan metode substitusi sederhana. Dalam enkripsi ini, orang tersebut hanya mengubah karakter abjad (a..z). Huruf kapital diubah ke huruf kecil sebelum dienkripsi. Karakter lain (angka, spasi, koma, titik, dan lain-lain) tidak dienkripsi.

Gunakan metode statistik dan trial-error untuk dekrip cipherteks berikut:

tve lescejtwnk ns tve brkbvwke nk tve bknaz vwygcgzgk pegib agb, snl bricr, cwie g ocwttelwko xwgynkx -- gk gebtvetwj gkx bpwlwtrgc eupelwekje. tve bwovt agb bn btrkkwko ve jnrcx nkcz tvwki wk twye-anlk pvlgbeb: "wb tvwb tve btgwlagz tn vegmek?" tve eupelwekje vgb cex tn gk euvwfwtwnk ns pgwktwkob slny swsteektv ns grorbt, tvlnrov swsteektv ns bepteyfel gt tve inygkeig swke glt ogccelz, wk rfrx. bricr bgwx vwb flwes hnrlkez tn kepgc vgx ekcwovtekex vwy.

 

Solved

Mendeteksi apakah mono-alphabetical atau poly-alphabetical?  Gunakan Friedman test.

friedman_test

################################################################
Friedman Test
################################################################

----------------------------------------------------------------
[v] Amount of charachter with space:  459

----------------------------------------------------------------
[v] Statistics: 

i 	n 	n-1 	n(n-1)
----------------------------------------------------------------
e  	46  	45  	2070
t  	34  	33  	1122
w  	34  	33  	1122
k  	33  	32  	1056
g  	28  	27  	756
v  	26  	25  	650
b  	24  	23  	552
n  	21  	20  	420
l  	16  	15  	240
c  	14  	13  	182
r  	14  	13  	182
s  	13  	12  	156
o  	9  	8  	72
x  	9  	8  	72
p  	8  	7  	56
i  	7  	6  	42
y  	7  	6  	42
z  	6  	5  	30
a  	5  	4  	20
j  	5  	4  	20
f  	4  	3  	12
u  	3  	2  	6
h  	1  	0  	0
m  	1  	0  	0
d  	0  	-1  	0
q  	0  	-1  	0
 	368  	 	8880

----------------------------------------------------------------
[v] Result:  0.0657505034948

----------------------------------------------------------------
[v] Cipher jenis:  Mono-Alphabetical

----------------------------------------------------------------
[v] Length of key:  0.98557399956 ~ 1.0

################################################################
End of | Friedman Test
################################################################

 

Ini tabel subtitusinya.

a -> W
b -> S
c -> L
d -> Z
e -> E
f -> B
g -> A
h -> J
i -> K
j -> C
k -> N
l -> R
m -> V
n -> O
o -> G
p -> P
q -> Q
r -> U
s -> F
t -> T
u -> X
v -> H
w -> I
x -> D
y -> M
z -> Y

Dan ini hasilnya.

the reflection of the sunshine on the snowy himalayan peaks was, for suklu, like a glittering diamond -- an aesthetic and spiritual experience. the sight was so stunning he could only think in time-worn phrases: "is this the stairway to heaven?" the experience has led to an exhibition of paintings from fifteenth of august, through fifteenth of september at the komaneka fine art gallery, in ubud. suklu said his brief journey to nepal had enlightened him.

 

Sekian tulisan hari ini, semoga bermanfaat.

Keep Fun Coding 😀

[1] Munir, Rinaldi. (2004) Kriptanalis Sederhana.  Tersedia: (????). [4 Februari 2015].

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s