{"id":434,"date":"2011-04-04T05:11:09","date_gmt":"2011-04-04T05:11:09","guid":{"rendered":"http:\/\/blog.elkom08.x10.bz\/?p=49"},"modified":"2014-11-24T10:55:10","modified_gmt":"2014-11-24T10:55:10","slug":"implementasi-cipher-dengan-php","status":"publish","type":"post","link":"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/","title":{"rendered":"Implementasi cipher dengan PHP"},"content":{"rendered":"<p>Kemarin kebetulan belajar keamanan informasi tentang enkripsi, dan di ajarkan beberapa enkripsi yaitu caesar cipher dan vigenere cipher. tiba tiba terfikir ingin mencoba membuat cipher dengan PHP, berhubung saya sedang menggemari bahasa tersebut. ya alhamdulillah setelah beberapa hari akhirnya jadi juga \ud83d\ude00<\/p>\n<p>untuk menjelaskan programnya satu persatu, mungkin akan memakan banyak waktu, jadi saya cuma copas listing programnya saja, untuk penjelasan mengenail syntaxnya banyak sekali di temukan di <a href=\"http:\/\/google.com\" target=\"_self\">Google<\/a> atau di <a href=\"http:\/\/w3schools.com\" target=\"_self\">W3schools<\/a>.<\/p>\n<p>yang pertama buat file untuk convertnya, beri nama <strong>convert.php<\/strong><\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&lt;?php\r\n\/*\r\n *      convert.php\r\n *      \r\n *      Copyright 2011 Ahmad Zafrullah Mardiansyah &lt;zaf@zaf-laptop&gt;\r\n *      \r\n *      This program is free software; you can redistribute it and\/or modify\r\n *      it under the terms of the GNU General Public License as published by\r\n *      the Free Software Foundation; either version 2 of the License, or\r\n *      (at your option) any later version.\r\n *      \r\n *      This program is distributed in the hope that it will be useful,\r\n *      but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n *      GNU General Public License for more details.\r\n *      \r\n *      You should have received a copy of the GNU General Public License\r\n *      along with this program; if not, write to the Free Software\r\n *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\r\n *      MA 02110-1301, USA.\r\n *\/\r\n \r\nfunction char_to_dec($a){\r\n\t$i=ord($a);\r\n\tif ($i&gt;=97 &amp;&amp; $i&lt;=122){\r\n\t\treturn ($i-96);\r\n\t} else if ($i&gt;=65 &amp;&amp; $i&lt;=90){\r\n\t\treturn ($i-38);\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nfunction dec_to_char($a){\r\n\tif ($a&gt;=1 &amp;&amp; $a&lt;=26){\r\n\t\treturn (chr($a+96));\r\n\t} else if ($a&gt;=27 &amp;&amp; $a&lt;=52){\r\n\t\treturn (chr($a+38));\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nfunction tabel_vigenere_encrypt($a, $b){\r\n\t$i=$a+$b-1;\r\n\tif ($i&gt;26){\r\n\t\t$i=$i-26;\r\n\t}\r\n\treturn (dec_to_char($i));\r\n}\r\nfunction tabel_vigenere_decrypt($a, $b){\r\n\t$i=$a-$b+1;\r\n\tif ($i&lt;1){\r\n\t\t$i=$i+26;\r\n\t}\r\n\treturn (dec_to_char($i));\r\n}\r\n\r\n?&gt;<\/pre>\n<p><!--more--><br \/>\nkemudian untuk\u00a0 <strong>index.php<\/strong> nya<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&lt;?php\r\n\/*\r\n *      index.php\r\n *      \r\n *      Copyright 2011 Ahmad Zafrullah Mardiansyah &lt;zaf@zaf-laptop&gt;\r\n *      \r\n *      This program is free software; you can redistribute it and\/or modify\r\n *      it under the terms of the GNU General Public License as published by\r\n *      the Free Software Foundation; either version 2 of the License, or\r\n *      (at your option) any later version.\r\n *      \r\n *      This program is distributed in the hope that it will be useful,\r\n *      but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n *      GNU General Public License for more details.\r\n *      \r\n *      You should have received a copy of the GNU General Public License\r\n *      along with this program; if not, write to the Free Software\r\n *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\r\n *      MA 02110-1301, USA.\r\n *\/\r\n \r\ninclude &quot;convert.php&quot;;\r\n\r\n?&gt;\r\n\r\n&lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Strict\/\/EN&quot;\r\n  &quot;http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-strict.dtd&quot;&gt;\r\n&lt;html xmlns=&quot;http:\/\/www.w3.org\/1999\/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;\r\n\r\n&lt;head&gt;\r\n\t&lt;title&gt;cipher | 23Pstars&lt;\/title&gt;\r\n\t&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text\/html;charset=utf-8&quot; \/&gt;\r\n\t&lt;meta name=&quot;generator&quot; content=&quot;Geany 0.18&quot; \/&gt;\r\n\t&lt;style type=&quot;text\/css&quot;&gt;\r\n\ta:link {color: #000000; text-decoration: none}\r\n\ta:visited {color: #000000; text-decoration: none}\r\n\ta:hover {color: #FF0000; text-decoration: underline}\r\n\t&lt;\/style&gt;\r\n\t&lt;script type=&quot;text\/javascript&quot;&gt;\r\n\tfunction SelectAll(id){\r\n\t\tdocument.getElementById(id).focus();\r\n\t\tdocument.getElementById(id).select();\r\n\t}\r\n\tfunction Info(){\r\n\t\talert(&quot;Original code by :&quot;+'\\n\\n'+&quot;Ahmad Zafrullah Mardiansyah&quot;);\r\n\t}\r\n\tfunction InfoCaesar(){\r\n\t\talert(&quot;Key hanya berupa kombinasi angka,&quot;+'\\n'+&quot;dan plan text tidak boleh mengandung angka!&quot;);\r\n\t}\r\n\tfunction InfoVigenere(){\r\n\t\talert(&quot;Key hanya berupa kombinasi kata, tidak boleh mengandung angka,&quot;+'\\n'+&quot;dan plan text tidak boleh mengandung angka!&quot;);\r\n\t}\r\n\t&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\t&lt;center&gt;\r\n\t&lt;h2&gt;Simple cipher implementation with PHP&lt;\/h2&gt;\r\n\t&lt;h4&gt;&lt;a onclick=&quot;Info()&quot;&gt;by 23Pstars&lt;\/a&gt;&lt;\/h4&gt;\r\n\t&lt;\/center&gt;\r\n\t&lt;table width=&quot;600&quot; align=&quot;center&quot;&gt;\r\n\t&lt;tr&gt;&lt;td width=&quot;50%&quot; valign=&quot;top&quot;&gt;\r\n\t&lt;fieldset&gt;\r\n\t&lt;legend&gt;&lt;b&gt;Caesar&lt;\/b&gt;&lt;\/legend&gt;\r\n\t&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;\r\n\t&lt;input type=&quot;text&quot; name=&quot;key_caesar&quot; id=&quot;key_caesar&quot; value=&quot;the key...&quot; onclick=&quot;SelectAll('key_caesar')&quot; \/&gt;\r\n\t&lt;input type=&quot;submit&quot; value=&quot;?&quot; onclick=&quot;InfoCaesar()&quot; \/&gt;&lt;br\/&gt;\r\n\t&lt;textarea rows=&quot;4&quot; name=&quot;plantext_caesar&quot; id=&quot;plantext_caesar&quot; cols=&quot;33&quot; onclick=&quot;SelectAll('plantext_caesar')&quot; &gt;plan text...&lt;\/textarea&gt;&lt;br\/&gt;\r\n\t&lt;input type=&quot;submit&quot; name=&quot;encrypt_caesar&quot; value=&quot;Encrypt&quot; \/&gt;&lt;input type=&quot;submit&quot; name=&quot;decrypt_caesar&quot; value=&quot;Decrypt&quot; \/&gt;&lt;input type=&quot;reset&quot; value=&quot;Reset&quot; \/&gt;\r\n\t&lt;\/form&gt;\r\n\t&lt;\/fieldset&gt;\r\n\t&lt;\/td&gt;&lt;td valign=&quot;top&quot; colspan=&quot;3&quot;&gt;\r\n\t&lt;fieldset&gt;\r\n\t&lt;legend&gt;&lt;b&gt;Result&lt;\/b&gt;&lt;\/legend&gt;\r\n\t&lt;?php\r\n\t\/\/----------------------------------------------------------------\/\/\r\n\t\/\/ caesar\t\t\t\t\t\t\t\t\t\t\t\t\t\t  \/\/\r\n\t\/\/----------------------------------------------------------------\/\/\r\n\t\tif((isset($_POST&#x5B;'key_caesar'])) &amp;&amp; (isset($_POST&#x5B;'plantext_caesar'])) &amp;&amp; isset($_POST&#x5B;'encrypt_caesar'])){\r\n\t\t\t$key=$_POST&#x5B;'key_caesar'];\r\n\t\t\t$plantext=$_POST&#x5B;'plantext_caesar'];\r\n\t\t\t$split_key=str_split($key);\r\n\t\t\t$i=0;\r\n\t\t\t$split_chr=str_split($plantext);\r\n\t\t\twhile ($key&gt;52){\r\n\t\t\t\t$key=$key-52;\r\n\t\t\t}\r\n\t\t\tforeach($split_chr as $chr){\r\n\t\t\t\tif (char_to_dec($chr)!=null){\r\n\t\t\t\t\t$split_nmbr&#x5B;$i]=char_to_dec($chr);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$split_nmbr&#x5B;$i]=$chr;\r\n\t\t\t\t}\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\techo '&lt;textarea rows=&quot;4&quot; id=&quot;result&quot; cols=&quot;33&quot; onclick=&quot;SelectAll(\\'result\\')&quot; &gt;';\r\n\t\t\tforeach($split_nmbr as $nmbr){\r\n\t\t\t\tif (($nmbr+$key)&gt;52){\r\n\t\t\t\t\tif (dec_to_char($nmbr)!=null){\r\n\t\t\t\t\t\techo dec_to_char(($nmbr+$key)-52);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\techo $nmbr;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (dec_to_char($nmbr)!=null){\r\n\t\t\t\t\t\techo dec_to_char($nmbr+$key);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\techo $nmbr;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo '&lt;\/textarea&gt;&lt;br\/&gt;';\r\n\t\t} else if ((isset($_POST&#x5B;'key_caesar'])) &amp;&amp; (isset($_POST&#x5B;'plantext_caesar'])) &amp;&amp; isset($_POST&#x5B;'decrypt_caesar'])){\r\n\t\t\t$key=$_POST&#x5B;'key_caesar'];\r\n\t\t\t$plantext=$_POST&#x5B;'plantext_caesar'];\r\n\t\t\t$i=0;\r\n\t\t\t$split_chr=str_split($plantext);\r\n\t\t\twhile ($key&gt;52){\r\n\t\t\t\t$key=$key-52;\r\n\t\t\t}\r\n\t\t\tforeach($split_chr as $chr){\r\n\t\t\t\tif (char_to_dec($chr)!=null){\r\n\t\t\t\t\t$split_nmbr&#x5B;$i]=char_to_dec($chr);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$split_nmbr&#x5B;$i]=$chr;\r\n\t\t\t\t}\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\techo '&lt;textarea rows=&quot;4&quot; id=&quot;result&quot; cols=&quot;33&quot; onclick=&quot;SelectAll(\\'result\\')&quot; &gt;';\r\n\t\t\tforeach($split_nmbr as $nmbr){\r\n\t\t\t\tif (($nmbr-$key)&lt;1){\r\n\t\t\t\t\tif (dec_to_char($nmbr)!=null){\r\n\t\t\t\t\t\techo dec_to_char(($nmbr-$key)+52);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\techo $nmbr;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (dec_to_char($nmbr)!=null){\r\n\t\t\t\t\t\techo dec_to_char($nmbr-$key);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\techo $nmbr;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo '&lt;\/textarea&gt;&lt;br\/&gt;';\r\n\t\t\t\r\n\t\/\/----------------------------------------------------------------\/\/\r\n\t\/\/ vigenere\t\t\t\t\t\t\t\t\t\t\t\t\t\t  \/\/\r\n\t\/\/----------------------------------------------------------------\/\/\r\n\t\t} else if ((isset($_POST&#x5B;'key_vigenere'])) &amp;&amp; (isset($_POST&#x5B;'plantext_vigenere'])) &amp;&amp; (isset($_POST&#x5B;'encrypt_vigenere']))){\r\n\t\t\t$key=$_POST&#x5B;'key_vigenere'];\r\n\t\t\t$plantext=$_POST&#x5B;'plantext_vigenere'];\r\n\t\t\t$len_key=strlen($key);\r\n\t\t\t$len_plantext=strlen($plantext);\r\n\t\t\t$split_key=str_split($key);\r\n\t\t\t$split_plantext=str_split($plantext);\r\n\t\t\t\r\n\t\t\techo '&lt;textarea rows=&quot;4&quot; id=&quot;result&quot; cols=&quot;33&quot; onclick=&quot;SelectAll(\\'result\\')&quot; &gt;';\r\n\t\t\t$i=0;\r\n\t\t\tfor($j=0;$j&lt;$len_plantext;$j++){\r\n\t\t\t\tif ($i==$len_key){\r\n\t\t\t\t\t$i=0;\r\n\t\t\t\t}\r\n\t\t\t\t$split_key2&#x5B;$j]=$split_key&#x5B;$i];\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\tfor($k=0;$k&lt;$len_plantext;$k++){\r\n\t\t\t\t$a=char_to_dec($split_key2&#x5B;$k]);\r\n\t\t\t\t$b=char_to_dec($split_plantext&#x5B;$k]);\r\n\t\t\t\tif (($a &amp;&amp; $b)!=null){\r\n\t\t\t\t\techo (tabel_vigenere_encrypt($a, $b));\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo $split_plantext&#x5B;$k];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo '&lt;\/textarea&gt;&lt;br\/&gt;';\r\n\t\t} else if ((isset($_POST&#x5B;'key_vigenere'])) &amp;&amp; (isset($_POST&#x5B;'plantext_vigenere'])) &amp;&amp; (isset($_POST&#x5B;'decrypt_vigenere']))){\r\n\t\t\t$key=$_POST&#x5B;'key_vigenere'];\r\n\t\t\t$plantext=$_POST&#x5B;'plantext_vigenere'];\r\n\t\t\t$len_key=strlen($key);\r\n\t\t\t$len_plantext=strlen($plantext);\r\n\t\t\t$split_key=str_split($key);\r\n\t\t\t$split_plantext=str_split($plantext);\r\n\t\t\t\r\n\t\t\techo '&lt;textarea rows=&quot;4&quot; id=&quot;result&quot; cols=&quot;33&quot; onclick=&quot;SelectAll(\\'result\\')&quot; &gt;';\r\n\t\t\t$i=0;\r\n\t\t\tfor($j=0;$j&lt;$len_plantext;$j++){\r\n\t\t\t\tif ($i==$len_key){\r\n\t\t\t\t\t$i=0;\r\n\t\t\t\t}\r\n\t\t\t\t$split_key2&#x5B;$j]=$split_key&#x5B;$i];\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor($k=0;$k&lt;$len_plantext;$k++){\r\n\t\t\t\t$a=char_to_dec($split_key2&#x5B;$k]);\r\n\t\t\t\t$b=char_to_dec($split_plantext&#x5B;$k]);\r\n\t\t\t\tif (($a &amp;&amp; $b)!=null){\r\n\t\t\t\t\techo (tabel_vigenere_decrypt($b, $a));\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo $split_plantext&#x5B;$k];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo '&lt;\/textarea&gt;&lt;br\/&gt;';\r\n\r\n\t\t} else {\r\n\t\t\techo &quot;result here...&quot;;\r\n\t\t}\r\n\t?&gt;\r\n\t&lt;\/fieldset&gt;\r\n\t&lt;\/td&gt;&lt;\/tr&gt;\r\n\t&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;\r\n\t&lt;fieldset&gt;\r\n\t&lt;legend&gt;&lt;b&gt;Vigenere&lt;\/b&gt;&lt;\/legend&gt;\r\n\t&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;\r\n\t&lt;input type=&quot;text&quot; name=&quot;key_vigenere&quot; id=&quot;key_vigenere&quot; value=&quot;the key...&quot; onclick=&quot;SelectAll('key_vigenere')&quot; \/&gt;\r\n\t&lt;input type=&quot;submit&quot; value=&quot;?&quot; onclick=&quot;InfoVigenere()&quot; \/&gt;&lt;br\/&gt;\r\n\t&lt;textarea rows=&quot;4&quot; name=&quot;plantext_vigenere&quot; id=&quot;plantext_vigenere&quot; cols=&quot;33&quot; onclick=&quot;SelectAll('plantext_vigenere')&quot; &gt;plan text...&lt;\/textarea&gt;&lt;br\/&gt;\r\n\t&lt;input type=&quot;submit&quot; name=&quot;encrypt_vigenere&quot; value=&quot;Encrypt&quot; \/&gt;&lt;input type=&quot;submit&quot; name=&quot;decrypt_vigenere&quot; value=&quot;Decrypt&quot; \/&gt;&lt;input type=&quot;reset&quot; value=&quot;Reset&quot; \/&gt;\r\n\t&lt;\/form&gt;\r\n\t&lt;\/fieldset&gt;\r\n\t&lt;\/td&gt;&lt;\/tr&gt;\r\n\t&lt;!-- masih dalam pengerjaan :p\r\n\t&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;\r\n\t&lt;fieldset&gt;\r\n\t&lt;legend&gt;&lt;b&gt;Playfair&lt;\/b&gt;&lt;\/legend&gt;\r\n\t&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;\r\n\t&lt;input type=&quot;text&quot; name=&quot;key_playfair&quot; id=&quot;key_playfair&quot; value=&quot;the key...&quot; onclick=&quot;SelectAll('key_playfair')&quot; \/&gt;&lt;br\/&gt;\r\n\t&lt;textarea rows=&quot;4&quot; name=&quot;plantext_playfair&quot; id=&quot;plantext_playfair&quot; cols=&quot;33&quot; onclick=&quot;SelectAll('plantext_playfair')&quot; &gt;plan text...&lt;\/textarea&gt;&lt;br\/&gt;\r\n\t&lt;input type=&quot;submit&quot; name=&quot;encrypt_playfair&quot; value=&quot;Encrypt&quot; \/&gt;&lt;input type=&quot;submit&quot; name=&quot;Decrypt_playfair&quot; value=&quot;Decrypt&quot; \/&gt;&lt;input type=&quot;reset&quot; value=&quot;Reset&quot; \/&gt;\r\n\t&lt;\/form&gt;\r\n\t&lt;\/fieldset&gt;\r\n\t&lt;\/td&gt;&lt;\/tr&gt;\r\n\t--&gt;\r\n\t&lt;\/table&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>kemudian untuk hasil jadinya bisa di lihat di <a href=\"http:\/\/zaf.web.id\/labs\/cipher\">http:\/\/zaf.web.id\/labs\/cipher<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kemarin kebetulan belajar keamanan informasi tentang enkripsi, dan di ajarkan beberapa enkripsi yaitu caesar cipher&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[57],"tags":[89,90,100,82,111],"class_list":["post-434","post","type-post","status-publish","format-standard","hentry","category-programming","tag-caesar","tag-cipher","tag-keamanan-informasi","tag-php","tag-vigenere"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Implementasi cipher dengan PHP - Ahmad Zafrullah<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/\" \/>\n<meta property=\"og:locale\" content=\"id_ID\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Implementasi cipher dengan PHP - Ahmad Zafrullah\" \/>\n<meta property=\"og:description\" content=\"Kemarin kebetulan belajar keamanan informasi tentang enkripsi, dan di ajarkan beberapa enkripsi yaitu caesar cipher&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/\" \/>\n<meta property=\"og:site_name\" content=\"Ahmad Zafrullah\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/23Pstars\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/23Pstars\" \/>\n<meta property=\"article:published_time\" content=\"2011-04-04T05:11:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-24T10:55:10+00:00\" \/>\n<meta name=\"author\" content=\"Zaf\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@23Pstars\" \/>\n<meta name=\"twitter:site\" content=\"@23Pstars\" \/>\n<meta name=\"twitter:label1\" content=\"Ditulis oleh\" \/>\n\t<meta name=\"twitter:data1\" content=\"Zaf\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimasi waktu membaca\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 menit\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/\"},\"author\":{\"name\":\"Zaf\",\"@id\":\"https:\/\/zaf.web.id\/blog\/#\/schema\/person\/ba4e955d59a1e6a8284857e74b14e5ed\"},\"headline\":\"Implementasi cipher dengan PHP\",\"datePublished\":\"2011-04-04T05:11:09+00:00\",\"dateModified\":\"2014-11-24T10:55:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/\"},\"wordCount\":1778,\"commentCount\":23,\"publisher\":{\"@id\":\"https:\/\/zaf.web.id\/blog\/#\/schema\/person\/ba4e955d59a1e6a8284857e74b14e5ed\"},\"keywords\":[\"caesar\",\"cipher\",\"keamanan informasi\",\"php\",\"vigenere\"],\"articleSection\":[\"Programming\"],\"inLanguage\":\"id\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/\",\"url\":\"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/\",\"name\":\"Implementasi cipher dengan PHP - Ahmad Zafrullah\",\"isPartOf\":{\"@id\":\"https:\/\/zaf.web.id\/blog\/#website\"},\"datePublished\":\"2011-04-04T05:11:09+00:00\",\"dateModified\":\"2014-11-24T10:55:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/#breadcrumb\"},\"inLanguage\":\"id\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/zaf.web.id\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Implementasi cipher dengan PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zaf.web.id\/blog\/#website\",\"url\":\"https:\/\/zaf.web.id\/blog\/\",\"name\":\"Ahmad Zafrullah\",\"description\":\"Work to Learn is better than Learn how to Work\",\"publisher\":{\"@id\":\"https:\/\/zaf.web.id\/blog\/#\/schema\/person\/ba4e955d59a1e6a8284857e74b14e5ed\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zaf.web.id\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"id\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/zaf.web.id\/blog\/#\/schema\/person\/ba4e955d59a1e6a8284857e74b14e5ed\",\"name\":\"Zaf\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2024\/09\/zaf_auto_x2.jpeg?fit=300%2C300&ssl=1\",\"url\":\"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2024\/09\/zaf_auto_x2.jpeg?fit=300%2C300&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2024\/09\/zaf_auto_x2.jpeg?fit=300%2C300&ssl=1\",\"width\":300,\"height\":300,\"caption\":\"Zaf\"},\"logo\":{\"@id\":\"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2024\/09\/zaf_auto_x2.jpeg?fit=300%2C300&ssl=1\"},\"sameAs\":[\"http:\/\/zaf.web.id\",\"http:\/\/www.facebook.com\/23Pstars\",\"https:\/\/x.com\/23Pstars\"],\"url\":\"https:\/\/zaf.web.id\/blog\/author\/zaf\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Implementasi cipher dengan PHP - Ahmad Zafrullah","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/","og_locale":"id_ID","og_type":"article","og_title":"Implementasi cipher dengan PHP - Ahmad Zafrullah","og_description":"Kemarin kebetulan belajar keamanan informasi tentang enkripsi, dan di ajarkan beberapa enkripsi yaitu caesar cipher&hellip;","og_url":"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/","og_site_name":"Ahmad Zafrullah","article_publisher":"http:\/\/www.facebook.com\/23Pstars","article_author":"http:\/\/www.facebook.com\/23Pstars","article_published_time":"2011-04-04T05:11:09+00:00","article_modified_time":"2014-11-24T10:55:10+00:00","author":"Zaf","twitter_card":"summary_large_image","twitter_creator":"@23Pstars","twitter_site":"@23Pstars","twitter_misc":{"Ditulis oleh":"Zaf","Estimasi waktu membaca":"9 menit"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/#article","isPartOf":{"@id":"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/"},"author":{"name":"Zaf","@id":"https:\/\/zaf.web.id\/blog\/#\/schema\/person\/ba4e955d59a1e6a8284857e74b14e5ed"},"headline":"Implementasi cipher dengan PHP","datePublished":"2011-04-04T05:11:09+00:00","dateModified":"2014-11-24T10:55:10+00:00","mainEntityOfPage":{"@id":"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/"},"wordCount":1778,"commentCount":23,"publisher":{"@id":"https:\/\/zaf.web.id\/blog\/#\/schema\/person\/ba4e955d59a1e6a8284857e74b14e5ed"},"keywords":["caesar","cipher","keamanan informasi","php","vigenere"],"articleSection":["Programming"],"inLanguage":"id","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/","url":"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/","name":"Implementasi cipher dengan PHP - Ahmad Zafrullah","isPartOf":{"@id":"https:\/\/zaf.web.id\/blog\/#website"},"datePublished":"2011-04-04T05:11:09+00:00","dateModified":"2014-11-24T10:55:10+00:00","breadcrumb":{"@id":"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/#breadcrumb"},"inLanguage":"id","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zaf.web.id\/blog\/implementasi-cipher-dengan-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zaf.web.id\/blog\/"},{"@type":"ListItem","position":2,"name":"Implementasi cipher dengan PHP"}]},{"@type":"WebSite","@id":"https:\/\/zaf.web.id\/blog\/#website","url":"https:\/\/zaf.web.id\/blog\/","name":"Ahmad Zafrullah","description":"Work to Learn is better than Learn how to Work","publisher":{"@id":"https:\/\/zaf.web.id\/blog\/#\/schema\/person\/ba4e955d59a1e6a8284857e74b14e5ed"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zaf.web.id\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"id"},{"@type":["Person","Organization"],"@id":"https:\/\/zaf.web.id\/blog\/#\/schema\/person\/ba4e955d59a1e6a8284857e74b14e5ed","name":"Zaf","image":{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2024\/09\/zaf_auto_x2.jpeg?fit=300%2C300&ssl=1","url":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2024\/09\/zaf_auto_x2.jpeg?fit=300%2C300&ssl=1","contentUrl":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2024\/09\/zaf_auto_x2.jpeg?fit=300%2C300&ssl=1","width":300,"height":300,"caption":"Zaf"},"logo":{"@id":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2024\/09\/zaf_auto_x2.jpeg?fit=300%2C300&ssl=1"},"sameAs":["http:\/\/zaf.web.id","http:\/\/www.facebook.com\/23Pstars","https:\/\/x.com\/23Pstars"],"url":"https:\/\/zaf.web.id\/blog\/author\/zaf\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":117,"url":"https:\/\/zaf.web.id\/blog\/jebakan-halaman-admin-php\/","url_meta":{"origin":434,"position":0},"title":"Jebakan halaman admin PHP","author":"Zaf","date":"April 14, 2011","format":false,"excerpt":"Mungkin kalo diperhatikan judul diatas memang agak membingungkan, tapi yang saya maksudkan disini adalah membuat sebuah konsep halaman admin untuk menjebak seorang hacker mencoba untuk menyerang site kita melalui halaman admin. Terinspirasi dari teman di sebuah forum yang memasang backdoor disebuah situs dan memproteksi backdoor tersebut menggunakan cara ini ^_^\u2026","rel":"","context":"dalam &quot;Inspirasi&quot;","block_context":{"text":"Inspirasi","link":"https:\/\/zaf.web.id\/blog\/category\/inspirasi\/"},"img":{"alt_text":"Screenshot from 2014-11-24 14:31:42","src":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2011\/04\/Screenshot-from-2014-11-24-143142.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":484,"url":"https:\/\/zaf.web.id\/blog\/serangan-campaign-malware\/","url_meta":{"origin":434,"position":1},"title":"Serangan Campaign Malware","author":"Zaf","date":"Desember 18, 2014","format":false,"excerpt":"Hari ini dipenghujung tahun 2014 ini adalah hari paling merepotkan selama mengelola salah satu Cloud milik LRsoft.\u00a0Pasalnya server mendapat kado natal istimewa berupa malware yang menginfeksi 60 lebih website yang\u00a0ada didalamnya, sehingga ketika domain web tersebut diakses via browser akan muncul peringatan block halaman dari layanan Google seperti gambar dibawah:\u2026","rel":"","context":"dalam &quot;Server&quot;","block_context":{"text":"Server","link":"https:\/\/zaf.web.id\/blog\/category\/server\/"},"img":{"alt_text":"Block dari Google","src":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2014\/12\/malware-frommshead.php_.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2014\/12\/malware-frommshead.php_.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2014\/12\/malware-frommshead.php_.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1885,"url":"https:\/\/zaf.web.id\/blog\/code-inception-kemudahan-upgrade-versi-php-di-phpstorm\/","url_meta":{"origin":434,"position":2},"title":"Code Inception: Kemudahan Upgrade Versi PHP di PhpStorm","author":"Zaf","date":"September 26, 2022","format":false,"excerpt":"Upgrade selalu menjadi mimpi buruk bagi seorang developer, tidak lepas juga bagi seorang web engineer. Performance dan security menjadi dua aspek yang sangat dipertimbangkan. Perubahan antar versi di PHP secara teknis dapat diketahui, apa saja fitur-fitur baru dan apa saja fitur-fitur yang sudah deprecated. Namun jika harus memeriksa satu persatu\u2026","rel":"","context":"dalam &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/zaf.web.id\/blog\/category\/programming\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-26-at-18.54.35.png?fit=1200%2C725&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-26-at-18.54.35.png?fit=1200%2C725&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-26-at-18.54.35.png?fit=1200%2C725&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-26-at-18.54.35.png?fit=1200%2C725&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2022\/11\/Screenshot-2022-11-26-at-18.54.35.png?fit=1200%2C725&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1501,"url":"https:\/\/zaf.web.id\/blog\/upload-file-sederhana-ke-aws-s3-dengan-php\/","url_meta":{"origin":434,"position":3},"title":"Upload File Sederhana ke AWS S3 dengan PHP","author":"Zaf","date":"Agustus 9, 2020","format":false,"excerpt":"AWS telah menyediakan SDK untuk memudahkan transaksi terhadap beberapa servicenya secara program, salah satu yang disediakan adalah untuk PHP. Namun terkadang kebutuhan tidak sesuai dengan usaha yang harus dikeluarkan. Untuk sekedar upload file ke S3 milik AWS kita perlu load\/download paket lengkap dari SDK nya, rasanya agak berlebihan. Setelah googling\u2026","rel":"","context":"dalam &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/zaf.web.id\/blog\/category\/programming\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2020\/08\/Screenshot-2024-09-06-at-00.22.03.png?fit=1200%2C813&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2020\/08\/Screenshot-2024-09-06-at-00.22.03.png?fit=1200%2C813&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2020\/08\/Screenshot-2024-09-06-at-00.22.03.png?fit=1200%2C813&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2020\/08\/Screenshot-2024-09-06-at-00.22.03.png?fit=1200%2C813&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2020\/08\/Screenshot-2024-09-06-at-00.22.03.png?fit=1200%2C813&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1954,"url":"https:\/\/zaf.web.id\/blog\/mitigasi-malware-di-web-server-dan-cara-membersihkannya\/","url_meta":{"origin":434,"position":4},"title":"Mitigasi Malware di Web Server dan Cara Membersihkannya","author":"Zaf","date":"November 23, 2022","format":false,"excerpt":"Malware selalu menjadi hal yang merepotkan. Umumnya pembuat malware tidak membuat malware untuk sekedar ajang pamer layaknya defacement. Malware dibuat demi tujuan yang lebih besar dan masif, dan biasanya tidak berjalan secara sendiri-sendiri melainkan menjadi sebuah network atau perkumpulan. Discovery Disuatu pagi tiba-tiba salah satu website yang kami kelola menunjukkan\u2026","rel":"","context":"dalam &quot;Security&quot;","block_context":{"text":"Security","link":"https:\/\/zaf.web.id\/blog\/category\/security\/"},"img":{"alt_text":"Mencari induk malware","src":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2022\/11\/6.-cari-dan-hapus-file-ico.png?fit=795%2C241&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2022\/11\/6.-cari-dan-hapus-file-ico.png?fit=795%2C241&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2022\/11\/6.-cari-dan-hapus-file-ico.png?fit=795%2C241&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2022\/11\/6.-cari-dan-hapus-file-ico.png?fit=795%2C241&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1059,"url":"https:\/\/zaf.web.id\/blog\/menambahkan-sertifikat-ssl-untuk-curl-di-php\/","url_meta":{"origin":434,"position":5},"title":"Menambahkan sertifikat SSL untuk cURL di PHP","author":"Zaf","date":"Maret 25, 2017","format":false,"excerpt":"Sejak PHP versi 5.6\u00a0autentikasi SSL terhadap akses cURL (CURLOPT_SSL_VERIFYPEER) default menjadi TRUE. Hal ini mengakibatkan\u00a0ketika menggunakan fungsi file_get_contents() selalu melakukan\u00a0validasi sertifikat SSL terhadap URL tujuan yang menggunakan protokol SSL. Meskipun URL tujuan telah terinstall sertifikat SSL yang valid, namun\u00a0cURL tidak dapat membuktikan validitas SSL jika belum memiliki dokumen pembanding sendiri\u2026","rel":"","context":"dalam &quot;Server&quot;","block_context":{"text":"Server","link":"https:\/\/zaf.web.id\/blog\/category\/server\/"},"img":{"alt_text":"SSL Certificate Logo","src":"https:\/\/i0.wp.com\/zaf.web.id\/blog\/wp-content\/uploads\/2017\/03\/ssl-certificate.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_likes_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4zLnS-70","_links":{"self":[{"href":"https:\/\/zaf.web.id\/blog\/wp-json\/wp\/v2\/posts\/434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zaf.web.id\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zaf.web.id\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zaf.web.id\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zaf.web.id\/blog\/wp-json\/wp\/v2\/comments?post=434"}],"version-history":[{"count":2,"href":"https:\/\/zaf.web.id\/blog\/wp-json\/wp\/v2\/posts\/434\/revisions"}],"predecessor-version":[{"id":443,"href":"https:\/\/zaf.web.id\/blog\/wp-json\/wp\/v2\/posts\/434\/revisions\/443"}],"wp:attachment":[{"href":"https:\/\/zaf.web.id\/blog\/wp-json\/wp\/v2\/media?parent=434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zaf.web.id\/blog\/wp-json\/wp\/v2\/categories?post=434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zaf.web.id\/blog\/wp-json\/wp\/v2\/tags?post=434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}