KRIPTOGRAFI
Kriptografi menurut sumber yang diambil dari sebuah buku Dasar-Dasar Keamanan Sistem Informasi, yang ditulis oleh Budi Rahardjo adalah ilmu dan seni untuk menjaga pesan agar aman. (Cryptography is the art and science of keeping messages secure. “Crypto” berarti “secret” (rahasia) dan “graphy” berarti “writing” (tulisan). Para pelaku atau praktisi kriptografi disebut cryptographers. Sebuah algoritma kriptografik (cryptographic algorithm), disebut cipher, merupakan persamaan matematik yang digunakan untuk proses enkripsi dan dekripsi. Biasanya kedua persamaan matematik (untuk enkripsi dan dekripsi) tersebut memiliki hubungan matematis yang cukup erat.
Proses yang dilakukan untuk mengamankan sebuah pesan (yang disebut plaintext) menjadi pesan yang tersembunyi (disebut ciphertext) adalah enkripsi (encryption). Ciphertext adalah pesan yang sudah tidak dapat dibaca dengan mudah. Menurut ISO 7498-2, terminologi yang lebih tepat digunakan adalah “encipher“.
Proses sebaliknya, untuk mengubah ciphertext menjadi plaintext, disebut dekripsi (decryption). Menurut ISO 7498-2, terminologi yang lebih tepat untuk proses ini adalah “decipher“.
Cryptanalysis adalah seni dan ilmu untuk memecahkan ciphertext tanpa bantuan kunci. Cryptanalyst adalah pelaku atau praktisi yang menjalankan cryptanalysis. Cryptology merupakan gabungan dari cryptography dan cryptanalysis. Plaintext adalah pesan atau informasi yang akan dikirimkan dalam format yang mudah dibaca atau dalam bentuk aslinya. Ciphertext adalah informasi yang sudah dienkripsi.
Salah satu penyerangan (attack) adalah dengan melakukan analisa statistik frekuensi huruf yang muncul dari suatu pesan atau berita. Cara ini disebut dengan “Frequency Analysis”. Dalam tugas 6 ini, penulis mencoba membuat program untuk menghitung banyaknya huruf yang keluar dari suatu pesan atau berita dengan menggunakan PHP.
Tujuan dari dibuatnya program ini adalah untuk membuktikan huruf apakah yang sering muncul dalam pesan yang menggunakan bahasa Indonesia dan bahasa Inggris.
Berikut ini adalah script pemrograman PHP yang diberi nama hitung.php:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″ />
<title>:: Analisa Statistik Frekuensi Huruf ::</title>
<style type=”text/css”>
<!–
body {
margin-left: 100px;
margin-right: 100px;
background-color: #666666;
margin-top: 0px;
background-image: url(images/backtile.jpg);
}
.style1 {color: #FFFFFF}
–>
</style>
<link href=”mm_travel2.css” rel=”stylesheet” type=”text/css” />
<style type=”text/css”>
<!–
.style2 {color: #000000; }
.style2 {
color: #FFFFFF
}
.style10 {
font-family: “Savoye LET”;
font-size: 24px;
}
.style13 {color: #CC9966}
.style16 {font-size: 18px}
.style18 {color: #000033}
.style19 {font-size: 14px; color: #000033; }
–>
</style>
<script language=”JavaScript” src=”mm_menu.js”></script>
</head>
<body>
<script language=”JavaScript1.2″>mmLoadMenus();</script>
<script language=”JavaScript” type=”text/javascript”>
//————— LOCALIZEABLE GLOBALS —————
var d=new Date();
var monthname=new Array(“Januari”,”Februari”,”Maret”,”April”,”Mei”,”Juni”,”Juli”,”Agustus”,”September”,”Oktober”,”November”,”Desember”);
//Ensure correct for language. English is “January 1, 2004″
//var TODAY = monthname[d.getMonth()] + ” ” + d.getDate() + “, ” + d.getFullYear();
var TODAY = d.getDate() + ” ” + monthname[d.getMonth()] + ” ” + d.getFullYear();
//————— END LOCALIZEABLE —————
</script>
</head>
<body>
<table width=”850″ border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″>
<tr>
<td bgcolor=”#666600″> </td>
</tr>
<tr>
<td bgcolor=”#666600″> </td>
</tr>
<tr>
<td bgcolor=”#FFFFFF”><table width=”850″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td width=”6″ height=”29″ bgcolor=”#003333″> </td>
<td width=”519″ height=”29″ bgcolor=”#003333″ class=”style1″> <script language=”JavaScript” type=”text/javascript”>
document.write(TODAY); </script></td>
<td width=”325″ bgcolor=”#003333″ class=”style1 style10″> <marquee scrollamount=”1″ scrolldelay=”10″ direction=”left” width=”300″ height=”25″>
</marquee></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor=”#FFFFFF”><table width=”850″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td width=”188″ height=”30″ align=”center” valign=”middle” bgcolor=”#663300″> </td>
<td width=”21″ height=”30″ bgcolor=”#663300″><div align=”center”><span class=”style2″><strong>|</strong></span></div></td>
<td height=”30″ bgcolor=”#663300″><div align=”center”><a href=”hitung.php” class=”navText style1″>ULANGI</a></div></td>
<td width=”21″ height=”30″ bgcolor=”#663300″><div align=”center”><span class=”style2″><strong>|</strong></span></div></td>
<td width=”211″ height=”30″ bgcolor=”#663300″> </td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor=”#FFFFFF”><table width=”850″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td width=”50″ height=”50″> </td>
<td width=”750″> </td>
<td width=”50″> </td>
</tr>
<tr>
<td height=”50″> </td>
<td>
<?php
if ($_POST[Enter]){
$hur=array();
$val=array();
$j=0;
$_POST[pesan]=strtolower($_POST[pesan]);
for($i=0;$i<=strlen($_POST[pesan])-1;$i++) {
if(!in_array($_POST[pesan]{$i},$hur)){
if(ord($_POST[pesan]{$i}) >96 AND ord($_POST[pesan]{$i})<123){
$hur[$j]=$_POST[pesan]{$i};
$val[$j]++;
$j++;
}
}
else {
$key=array_search($_POST[pesan]{$i},$hur);
$val[$key]++;
}
}
for($x = 0; $x < count($val)-1; $x++) {
for($y = 0; $y < count($val)-1; $y++) {
if($val[$x] > $val[$y]) {
$hold = $val[$x];
$val[$x] = $val[$y];
$val[$y] = $hold;
$temp = $hur[$x];
$hur[$x]=$hur[$y];
$hur[$y]=$temp;
}
}
}
?>
<table width=”800″ cellpadding=”0″ cellspacing=”1″ border=”1″>
<p>Berikut ini adalah urutan 5 besar huruf yang banyak keluar</p>
<p>
<?
//for($i=0;$i<=count($hur)-1;$i++){
for($i=0;$i<=4;$i++){
echo ‘<tr><td width=”10%” align=”center”>’.($hur[$i]==’ ‘?’spasi’:$hur[$i]).’</td><td width=”15%” align=”center”>’.$val[$i].’ (‘.number_format((($val[$i]/array_sum($val))*100),2,’.',”).’%)</td><td><img src=”grafik.gif” height=”20″ width=”‘.($val[$i]/array_sum($val)*100).’%”</td></tr>’;}
//}
echo ‘</table><br>Jumlah karakter yang dimasukkan: ‘.array_sum($val);
}
else {
?>
</p>
<p align=”center”>ANALISA STATISTIK FREKUENSI HURUF</p>
<p> </p>
<p>Masukkan kalimat atau berita yang akan dihitung jumlah karakternya, anda dapat melakukan copy dan paste : </p>
<form name=”form1″ method=”post” action=”<?=$_SERVER['PHP_SELF']?>”>
<label>
<textarea name=”pesan” cols=”90″ rows=”10″ wrap=”virtual”></textarea>
</label>
<br>
<br>
<label>
<input type=”submit” name=”Enter” value=”Enter”>
</label>
</form>
<?
}
?>
</td>
<td> </td>
</tr>
<tr>
<td height=”50″> </td>
<td> </td>
<td> </td>
</tr>
</table>
<tr>
<td height=”25″ bgcolor=”#003333″><div align=”center” class=”style1″></div></td>
</tr>
</table>
</body>
</html>
Setelah script di running dengan XAMPP di localhost, akan tampil seperti gambar di bawah.
Kemudian penulis mencoba mengambil berita yang menggunakan bahasa Indonesia dari portal berita detik.com, dan mem-paste berita tersebut (http://www.detiknews.com/read/2008/11/08/121559/1033459/10/festival-palang-pintu-3-digelar-kemang-raya-ditutup-dialihkan ). Isi berita tersebut adalah :
Sabtu, 08/11/2008 12:15 WIB
Festival Palang Pintu 3 Digelar, Kemang Raya Ditutup & Dialihkan
Niken Widya Yunita – detikNews
Jakarta – Bagi anda yang akan menghabiskan akhir pekan, Jalan Kemang Raya bisa menjadi alternatif. Di jalan itu diadakan Festival Palang Pintu 3 dan Budaya Betawi 2008. Oleh karena itu Jalan Kemang Raya ditutup.
Penutupan ini dimulai dari Jumat 07 November 2008 pukul 23.30 WIB. Rencananya penutupan akan berakhir pada Minggu 09 November 2008 pukul 23.30 WIB.
Dikutip dari situs Traffic Management Center (TMC) Polda Metro Jaya, Sabtu (8/11/2008), acara tersebut berisi pameran dan produk-produk khas betawi. Momen itu juga tidak dilewatkan oleh pedagang makanan Khas Betawi seperi kerak telor untuk menjajakan barang dagangannya.
Penutupan Jl Kemang Raya dimulai dari Pizza Hut Kemang Raya hingga Alfa Mart Kemang Raya. Bagi warga yang biasa melintasi Jl Kemang Raya, bisa melalui jalan alternatif sebagai berikut.
Dari Jl Bangka mengarah ke Jl Ampera Raya, Bangka Raya – MC. Donald’s Kemang (belok kiri) – Kemang Utara Raya – Kemang Timur – Ampera Raya. Bisa juga melalui Bangka Raya – Kemang Raya depan New Zealand School (belok kiri) – Kemang Selatan I – Kemang dalam 10 – Kemang Timur Dalam – Kemang Selatan 11 – Kemang Selatan Raya – Kemang Raya.
Kemudian untuk arah sebaliknya, dari Jl. Ampera Raya menuju Bangka Raya melalui rute Jl Ampera Raya – Kemang Timur Raya – Kemang Utara Raya – Kemang Utara I B – Bangka XI – Bangka Raya. atau alternatif lain melalui Jl Ampera Raya – Kemang Selatan Raya – Kemang Selatan 11 – Kemang Timur Dalam – Kemang dalam 10 – Kemang Selatan I – Jl Kemang Raya depan New Zealand School (belok kanan) arah Jl Bangka Raya.
Kemudian dari arah Jl Pangeran Antasari mengarah ke Jl Ampera Raya, yaitu: Pangeran Antasari – Kemang Selatan 8 (belok kiri) – Jl Kemang Raya depan New Zealand School (belok kanan) – Kemang Selatan I – Kemang dalam 10 – Kemang Timur Dalam – Kemang Selatan 11 – Kemang Selatan Raya – Ampera Raya.
Bagi yang mengarah dari Jl Benda ke Jl Bangka Raya bisa melalui Jl. Kemang Selatan Raya – Kemang Timur Raya – Kemang Utara Raya – Kemang Utara I B – Bangka XI – Bangka Raya.
Sedangkan untuk angkutan umum Kopaja 605 jurusan Blok M – Kampung Rambutan dialihkan melalui rute: Blok M – Jl Prapanca – Pangeran Antasari – Kemang Selatan 8 – Kemang Selatan 1 – Kemang Timur Dalam – Kemang Timur Raya – Jl Ampera Raya – Jl TB Simatupang.
Meski demikian awak angkutan lebih memilih untuk tidak beroperasi.
(nik/djo)
Berikut ini adalah hasil dari perhitungan program di atas:
Hasilnya adalah sebagai berikut:
Jumlah karakter yang dimasukkan adalah : 1886 karakter (Berita berbahasa Indonesia)
- Huruf ”a” sebanyak 405 huruf
- Huruf ”n” sebanyak 174 huruf
- Huruf “e” sebanyak 152 huruf
- Huruf “i” sebanyak 114 huruf
- Huruf “r” sebanyak 114 huruf
Kemudian penulis mencoba meng-input pesan / berita berbahasa Inggris dari portal berita BBC yang beralamat di http://news.bbc.co.uk/2/hi/asia-pacific/7717819.stm . Isi beritanya adalah sebagai berikut:
Indonesia‘s risk of making martyrs
By Lucy Williamson
BBC News, Cilacap
For men who turned the eyes of the world to Indonesia, it was a small and muted death.
Just a handful of witnesses and a firing squad, hidden away on Indonesia’s prison island.
There, in the darkness around midnight, three men convicted of carrying out Indonesia’s worst ever bomb attack, were shot though the heart.
It was the end of a six-year story that changed Indonesia, and its place in the world.
That story began in the darkness of another night – 12 October 2002 – on the nearby island of Bali, when bomb attacks ripped through two of the island’s busiest nightspots.
More than 200 people died: tourists, taxi drivers, night-club staff.
Among the dead were 88 Australians, 38 Indonesians and 28 Britons.
‘Too long’
Or perhaps the story really began earlier, in Java’s small villages. With three boys radicalised by a new generation of Islamic warriors – in Afghanistan and elsewhere – who fell in with South-east Asia’s network of radical Islamists, al-Jemaah Islamiya.
Wherever you begin the story, those attacks, carried out in the name of Islam, remade Indonesia’s sense of itself – and its relations with others.
And by the time they died tonight, those three men – Amrozi Nurhasyim, his brother Ali Ghufron (Mukhlas) and their colleague, Imam Samudra – had become some of its most famous faces.
It has been a long, unsettled wait for their executions. Most Indonesians – 85% of them Muslim – are firmly behind the death sentences handed down in 2003. Many even complained the government was taking too long.
Just days before the executions were carried out, locals here in the town of Cilacap – the main crossing point to the prison island – were dismissive.
“It’s taken too long already,” said Agus as he sold soup to crowds gathering outside the crossing point. “They should have been shot a long time ago.”
“The sooner they’re executed the better,” said Sadiman, another local resident who had come to see the arrival of so many heavily armed police in his tiny town.
“I saw on the television what they did in Bali – they’re international-level terrorists.”
Some of those years of waiting are the result of legal appeals. Repeated attempts by the men’s lawyers to argue that their conviction was unsound; that they had not been given a proper hearing.
A major sticking point has been the fact that the three men were tried and convicted under controversial anti-terrorism legislation passed immediately after the Bali attacks.
Their lawyers argued it could not be used retroactively.
Indonesia‘s Constitutional Court agreed. But its ruling was ignored by higher panels, and earlier this year the country’s chief prosecutor said the three men had finally exhausted all legal avenues of appeal.
Well, not quite all. Amrozi and his colleagues never expressed remorse for the attacks – never regretted killing people they describe as “infidels”. That meant they could never appeal to the highest authority in the land – and never asked for a presidential pardon.
Message
And in some ways, killing the three men presents as many problems as it solves.
It has the approval of many Indonesians, but it does not undo the fact that there is a radical minority here that supports what these men did. In fact, it may go some way towards keeping their message alive.
Officials here are said to be nervous about the possible reaction of that minority. Security is tight around key targets across the country, in Jakarta, in Bali, and here at the tiny crossing point of Cilacap.
Having finally carried out these executions, Indonesia is waiting for the response.
For days, the men Indonesia fears have been gathering in the bombers’ home villages – small hamlets at opposite ends of Java. Men who see them, not as outcasts, but as misguided martyrs, or even heroes.
They do not all agree with the Bali attacks, but neither do they agree with the executions. Some take the view that village boys like these could not make a bomb that big; that the hand of America or Israel was behind it.
Others make even finer distinctions. One Muslim leader, from the Council of Mujahideen, said he was not sure if the attacks were good or bad, but that the country needed more men like Amrozi; that kaffirs – unbelievers – were the enemies of Islam, and that Muslims should fight them.
It is late at night now, and the island is almost invisible. It sits, thickly black, just off Java’s coast; sealed and silent. And the men who made it famous are now waiting to be taken back to their family homes for burial.
Their deaths may have been low-key but this was a big step for Indonesia. Executing men who kill in the name of Islam sends a strong message here – one that most Indonesians agree with.
But it also risks undoing the country’s new, hard-won security if, in killing the Bali bombers, Indonesia has also made them into martyrs.
Berikut adalah gambar hasil perhitungan:
Jumlah karakter yang dimasukkan adalah : 3243 karakter (Berita berbahasa Inggris)
- Huruf ”e” sebanyak 414 huruf
- Huruf ”a” sebanyak 296 huruf
- Huruf “t” sebanyak 272 huruf
- Huruf “s” sebanyak 231 huruf
- Huruf “i” sebanyak 228 huruf
Kesimpulan:
- Dari hasil perhitungan dengan menggunakan program diatas, dapat disimpulkan bahwa dalam suatu pesan berbahasa Indonesia, huruf yang paling banyak muncul adalah huruf “a”. Penulis juga mencoba dengan sumber berita dari KOMPAS CYBER dan beberapa berita online lainnya, hasilnya tetap sama huruf “a” muncul paling banyak.
- Untuk pesan / berita yang berbahasa Inggris, ternyata huruf “e” adalah huruf yang paling banyak muncul. Penulis juga mencoba dengan sumber berita yang berbeda seperti CNN dll.
Referensi :
- Rahardjo, B. 2005. Dasar-Dasar Keamanan Sistem Informasi. Dalam : Keamanan Sistem Informasi berbasis Internet. PT Insan Infonesia – Bandung dan PT INDOCISC – Jakarta.
- DETIKCOM. 2008. http://www.detiknews.com/read/2008/11/08/121559/1033459/10/festival-palang-pintu-3-digelar-kemang-raya-ditutup-dialihkan.
- BBC Online. 2008. http://news.bbc.co.uk/2/hi/asia-pacific/7717819.stm .
Catatan Penulis :
Tulisan ini dibuat sebagai bagian dari tugas mata kuliah IF5166 – Keamanan Informasi Sistem Lanjut pada Magister Informatika, Bidang Khusus Chief Information Officer, Sekolah Teknik Elektro dan Informatika, Institut Teknologi Bandung.
Bandung, 9 November 2008
AFIFI
NIM. 23208072


