Javascript-based Encryption
Cara yang lebih baik adalah dengan menggunakan enkripsi. HTML Guardian (HG) adalah salah satu software yang populer untuk melindungi html dengan enkripsi. Html yang dilindungi dengan HG tidak bisa lagi dibaca dengan mata telanjang (view source). Halaman html yang tadinya rapi, mendadak menjadi kacau balau tak terbaca, penuh dengan kode javascript dan karakter string aneh.
Sebenarnya bagaimana cara kerja HG? Cara kerjanya sederhana. Ketika halaman yang telah dienkrip dengan HG di buka, maka kode javascript yang ada di dalamnya akan melakukan dekripsi menjadi kode html kembali. Kode html ini kemudian ditulis lagi ke browser. Kode html yang telah di-dekrip ini hanya tersimpan di memori browser, tidak di file, sehingga ketika orang mencari di kumpulan file cache tidak ditemukan. Dilihat dengan view source pun tidak akan terbaca.
Generated Source
Dari cara kerjanya, bisa kita ambil kesimpulan bahwa plain-text html nya sebenarnya tersedia, namun hanya beredar di memori browser. Jadi ketika javascript dijalankan, dia akan menghasilkan source, source ini lah yang disebut dengan Generated Source yang disimpan di memori browser.
Khusus pengguna Firefox, telah tersedia addon yang sangat ampuh, yaitu Web Developer. Dengan addon ini, dengan sekali klik saja kita bisa mendapatkan generated source yang tersimpan di memori browser.
Mari kita coba membongkar proteksi HG di halaman demonstrasi. Halaman ini memang khusus dibuat untuk menunjukkan fitur-fitur HG.
Bila kita view source halaman demo tersebut, maka yang kita dapatkan hanyalah kode html dan javascript. Semua konten htmlnya dimasukkan ke dalam kode javascript. Kode javascript untuk contoh demo tersebut adalah sebagai berikut:
<script type="text/javascript">
//<![CDATA[
l1l=document.all;var naa=true;ll1=document.layers;lll=window.sidebar;naa=(!(l1l&&ll1)&&!(!l1l&&!ll1&&!lll));l11=navigator.userAgent.toLowerCase();function lI1(l1I){return l11.indexOf(l1I)>0?true:false};lII=lI1('kht'|lI1('per';naa|=lII;O0O0=new Array();O0O0[0]='<!DOCTYPE HTML PUBLIC "-//W3C~DTD~ ~\r4.01 TransitionalEN"><html~9head~9script>ev~3(une~Eape(\'f~Pct%69~1%20\\161~d71%36~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iz~3|4}4|susmv}sj{||#u<s|bsUsQsX -tFx\' {Kso|3s=|Ubwc~RtHtqruwiz~.u-~+t6u(y;v&skltersqsou-v|zNwVu{|AuIv[|a~Fy~I_{Epvzh~<#pt2<t|tsv[{2yuGcuusPv~8|:u{t6rte~\ns?sAsCu$nst}|#a>.t r1sLrQ<tJzNsr!vr#{zrr&|c~;~=uR~.{v[ErZr\\uH~<ltq|5uPs\\t.sqrtr~-zN .rNu|5|:waot8uGidv[s8swr2tuftWupuir7r9sVo~8Comry|8rC~\rrEt.rGr{|Qu|V{7t8sc|Hrr~.|8rss~1rI~JrKrRr1uu9|kz`qruck;sc|b-|Us\'vu5rm~3~8[|Ft%hu-~.w"|@~~~Ixs
Sangat kacau bukan source javascriptnya? Tidak perlu pusing-pusing, kita biarkan saja browser yang meng-eksekusi code tersebut. Nanti setelah eksekusi selesai, dengan menggunakan addon web developer, kita bisa melihat source hasil eksekusi javascript tersebut. Sebagian hasil dekripsinya (karena sangat panjang) terlihat sebagai berikut:
<table border="0" width="85%">
<tbody>
<tr>
<td colspan="3">
<p class="tips" align="center"><b><u><font color="#FF0000">"Best product of its kind, bar
none."</font></u></b><br />
<font color="#000000">WebReview</font></p><br />
</td>
</tr>
<tr>
<td colspan="3" height="79">
<p class="tborder6" align="left"><b>Main HTML Guardian features:</b><br /></p>
<ul class="sli">
<li class="bli">A world standard for web intellectual property protection</li>
<li style="list-style: none">
<font class="sli">- all experts in web design, web security and intellectual property
protection <a href="encrypt_asp.htm#p0"><font class="bo" color="navy">recommend HTML
Guardian</font></a>.</font><br />
<br />
<center>
<a href="encrypt.html" title="Encrypt html, password protect website .. compare tools"
id="6" name="6"><font class="bo" color="#0000FF">Compare HTML Guardian to other tools for
website protection</font></a><br />
<font style="color: black; font-weight: normal;">[see why it is adopted worldwide as a
website protection standard]</font>
</center><br />
</li>
<li class="bli">Rock solid</li>
<li style="list-style: none"><font class="sli">- it will properly encrypt all html,
shtml, <a href="scripts.htm" class="s1i"><b>script</b></a> and asp files, not just some
of them. HTML Guardian's revolutionary <span class=
"bo">CodeAnalyzerâ„¢</span> engine debugs the encrypted code in realtime
and sends the appropriate feedback commands to the encryption engine. This ensures 100%
working and error-free encrypted files</font>.<br />
<br />
<a name="options" id="options"></a></li>
<li class="bli">Flexible encryption options:</li>
<li style="list-style: none; display: inline">
<ul>
<li class="sli"><b>Encrypt html</b> files, asp files, external script files(.js or .vbs),
<a href="encrypt_php.htm">php</a> and shtml files, framesets and style sheets (.css)
files. You can also encrypt HTML-formatted email.</li>
<li class="sli">Protect your images with <font class="bo" color="#0000FF">Image
Guardian</font> - enhanced <a href="image_protection.htm" title=
"Image Protection"><b>image protection</b></a>. <img src="new3.jpg" width="25" height=
"20" /></li>
<li class="sli">Encrypt only desired parts of html files.</li>
<li class="sli">Two different methods of encryption</li>
<li style="list-style: none"><font class="hg12p">- files encrypted with the default
method work in all javascript-enabled browsers. You can also use the alternative, more
fast and secure method for Internet Explorer 5.0 or higher only.</font></li>
<li class="sli">Disable right mouse button (right click).</li>
<li class="sli">Disable showing link targets in status bar.</li>
<li class="sli">Disable text selection.</li>
<li class="sli">Prohibit offline use</li>
<li style="list-style: none"><font class="hg12p">- your files will work fine when someone
is browsing your site, but they will not work if they are saved and run from a local hard
drive.</font></li>
<li class="sli">Password protect your pages using either a basic or <a href=
"html_password_protect.htm"><b><font color="#0000FF">Ultra-Strong password
protection</font></b></a>.<img src="new3.jpg" width="25" height="20" /></li>
<li class="sli">Prohibit linking your pages from other sites.</li>
<li class="sli">Prohibit printing of protected files.</li>
<li class="sli">Disable Clipboard & Print Screen ( for IE 5+ only ).</li>
<li class="sli">Option only to compress HTML code(without encryption).</li>
</ul><br />
</li>
<li class="bli">Encrypt either a single file, an entire web site or a file list at
once.</li>
<li style="list-style: none"><br />
<br /></li>
<li class="bli">Full command line support.</li>
<li style="list-style: none"><br />
<br /></li>
<li class="bli">Language independent</li>
<li style="list-style: none"><font class="hg12p">- HTML Guardian will properly encrypt
your files no matter what character set you use. You may have text in English, Chinese,
Russian, Japanese or any other language.</font><br />
<br /></li>
<li class="bli">Powerful partial encryption capabilities</li>
Kesimpulan
Client based protection doesn’t works. Walaupun source dibuat kacau balau seperti apapun, selama browser hanya mengerti html, harus dikembalikan ke bentuk yang dimengerti browser. Kita tidak perlu tahu mengerti javascript hasil scramble, cukup biarkan browser menjalankan tugasnya, dan kita hanya mau hasil akhirnya yang sudah rapi berbentuk html.
mas gimana cara proteksi char PB.....takut di hack orang......masak hack bisa tapi proteksi ngak bisa!!!!!?? monggo....
BalasHapus