{"id":636,"date":"2017-06-02T13:45:34","date_gmt":"2017-06-02T06:45:34","guid":{"rendered":"http:\/\/www.yellowweb.id\/blog\/?p=636"},"modified":"2017-06-02T13:45:34","modified_gmt":"2017-06-02T06:45:34","slug":"md5-di-php","status":"publish","type":"post","link":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/","title":{"rendered":"MD5 di PHP"},"content":{"rendered":"<p>MD5 (Message-Digest Algorithm 5) ialah fungsi hash kriptografik yang digunakan secara luas dengan hash value 128-bit. Implementasinya pada saat kita melakukan login pada sebuah aplikasi web seperti form pendaftaran.<br \/>\n<!--more--><\/p>\n<p>MD5 bertujuan mengenkripsi password di form login, pada saat kita menginputkan password. Enkripsi tersebut berguna supaya password yang kita inputkan tidak mudah terlacak, atau tidak mudah dibaca oleh orang-orang yang tidak berkepentingan.<\/p>\n<p>Langsung saja buka editor teman-teman, silahkan coba kita akan melakukan enkripsi<\/p>\n<pre class=\"lang:default decode:true \" >&lt;?php\r\n\t\r\n\t\/*\r\n\t\tvariable nama menampung huruf atau kata yellowweb\r\n\t\tkemudian akan di enkripsi dengan menggunakan md5\r\n\t\t\r\n\t*\/\r\n\r\n\t$nama = \"yellowweb\";\r\n\techo md5($nama);\r\n\r\n\t\/*\r\n\t\thasil dari enkripsi kata yellowweb\r\n\t\t6d1aa4d62c26f616ac450b5528ad6e72\r\n\t*\/\r\n\r\n?&gt;<\/pre>\n<p>Kita akan implementasikan pada sebuah form login, seperti berikut:<\/p>\n<p>1. Buat file koneksi terlebih dahulu<\/p>\n<pre class=\"lang:default decode:true \" >&lt;?php\r\n\t$server = \"localhost\";\r\n\t$user = \"root\";\r\n\t$pass = \"\";\r\n\t$dbase = \"db_login\";\r\n\r\n\tmysql_connect($server,$user,$pass) or die (\"Koneksi Gagal!\");\r\n\tmysql_select_db($dbase) or die (\"Database tidak bisa di buka\");<\/pre>\n<p>2. Form Input<\/p>\n<pre class=\"lang:default decode:true \" >&lt;?php\r\n\tinclude \"koneksi.php\";\r\n\r\n\tif(isset($_POST[\"submit\"])){\r\n\t\t$user = mysql_real_escape_string($_POST[\"username\"]);\r\n\t\t$pass = mysql_real_escape_string($_POST[\"password\"]);\r\n\t\t$pass = md5($pass);\r\n\r\n\t\t$sql = \"INSERT INTO tbl_user(user,pass) VALUES('$user','$pass')\";\r\n\t\t$query = mysql_query($sql) or die (mysql_error());\r\n\r\n\t\tif($query == TRUE){\r\n\t\t\theader(\"location: input_user.php?result=success\");\r\n\t\t} else {\r\n\t\t\techo \"gagal tambah user\";\r\n\t\t}\r\n\t}\r\n\r\n?&gt;\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n\t&lt;title&gt;Tambah User&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\t&lt;h3&gt;Tambah User&lt;\/h3&gt;\r\n\t&lt;?php\r\n\t\tif(isset($_GET[\"result\"])){\r\n\t\t\techo \"&lt;span style='background: green; color: #ffffff;'&gt;User berhasil ditambah!&lt;\/span&gt;\";\r\n\t\t}\r\n\t?&gt;\r\n\t&lt;table&gt;\r\n\t\t&lt;form action=\"\" method=\"POST\"&gt;\r\n\t\t\t&lt;tr&gt;\r\n\t\t\t\t&lt;td&gt;Username&lt;\/td&gt;\r\n\t\t\t\t&lt;td&gt;:&lt;\/td&gt;\r\n\t\t\t\t&lt;td&gt;&lt;input type=\"text\" name=\"username\" placeholder=\"Masukkan Username\" required=\"required\"&gt;&lt;\/td&gt;\r\n\t\t\t&lt;\/tr&gt;\r\n\t\t\t&lt;tr&gt;\r\n\t\t\t\t&lt;td&gt;Password&lt;\/td&gt;\r\n\t\t\t\t&lt;td&gt;:&lt;\/td&gt;\r\n\t\t\t\t&lt;td&gt;&lt;input type=\"password\" name=\"password\" placeholder=\"Masukkan Password\" required=\"required\"&gt;&lt;\/td&gt;\r\n\t\t\t&lt;\/tr&gt;\r\n\t\t\t&lt;tr&gt;\r\n\t\t\t\t&lt;td&gt;&lt;\/td&gt;\r\n\t\t\t\t&lt;td&gt;&lt;\/td&gt;\r\n\t\t\t\t&lt;td&gt;&lt;input type=\"submit\" name=\"submit\" value=\"Tambah\"&gt;&lt;\/td&gt;\r\n\t\t\t&lt;\/tr&gt;\r\n\t\t\t\r\n\t\t&lt;\/form&gt;\r\n\t&lt;\/table&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>Silahkan dicoba ya teman-teman, dan semoga bermanfaat. Sampai jumpa diartikel berikutnya.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MD5 (Message-Digest Algorithm 5) ialah fungsi hash kriptografik yang digunakan secara luas dengan hash value 128-bit. Implementasinya pada saat kita melakukan login pada sebuah aplikasi web seperti form pendaftaran.<\/p>\n","protected":false},"author":1,"featured_media":641,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[110,11],"tags":[340,299,339,329,88,214],"class_list":["post-636","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","category-tutorial","tag-enkripsi","tag-hak-akses","tag-md5","tag-password","tag-php","tag-programming"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MD5 di PHP - YELLOWWEB.ID<\/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:\/\/www.yellowweb.id\/blog\/md5-di-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MD5 di PHP - YELLOWWEB.ID\" \/>\n<meta property=\"og:description\" content=\"MD5 (Message-Digest Algorithm 5) ialah fungsi hash kriptografik yang digunakan secara luas dengan hash value 128-bit. Implementasinya pada saat kita melakukan login pada sebuah aplikasi web seperti form pendaftaran.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/\" \/>\n<meta property=\"og:site_name\" content=\"YELLOWWEB.ID\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-02T06:45:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/06\/md5-php.jpg?fit=750%2C350&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"yellowweb\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"yellowweb\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/\"},\"author\":{\"name\":\"yellowweb\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\"},\"headline\":\"MD5 di PHP\",\"datePublished\":\"2017-06-02T06:45:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/\"},\"wordCount\":101,\"image\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/md5-php.jpg\",\"keywords\":[\"enkripsi\",\"hak akses\",\"md5\",\"password\",\"php\",\"programming\"],\"articleSection\":[\"PHP\",\"Tutorial\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/\",\"name\":\"MD5 di PHP - YELLOWWEB.ID\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/md5-php.jpg\",\"datePublished\":\"2017-06-02T06:45:34+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/md5-php.jpg\",\"contentUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/md5-php.jpg\",\"width\":750,\"height\":350,\"caption\":\"md5-php\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/md5-di-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MD5 di PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/\",\"name\":\"YELLOWWEB.ID\",\"description\":\"Kursus Web Design | Kursus Web Programming | Mobile Web Apps | Digital Marketing\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\",\"name\":\"yellowweb\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"caption\":\"yellowweb\"},\"sameAs\":[\"https:\\\/\\\/www.yellowweb.id\"],\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/author\\\/yellowweb\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MD5 di PHP - YELLOWWEB.ID","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:\/\/www.yellowweb.id\/blog\/md5-di-php\/","og_locale":"en_GB","og_type":"article","og_title":"MD5 di PHP - YELLOWWEB.ID","og_description":"MD5 (Message-Digest Algorithm 5) ialah fungsi hash kriptografik yang digunakan secara luas dengan hash value 128-bit. Implementasinya pada saat kita melakukan login pada sebuah aplikasi web seperti form pendaftaran.","og_url":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/","og_site_name":"YELLOWWEB.ID","article_published_time":"2017-06-02T06:45:34+00:00","og_image":[{"width":750,"height":350,"url":"https:\/\/i0.wp.com\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/06\/md5-php.jpg?fit=750%2C350&ssl=1","type":"image\/jpeg"}],"author":"yellowweb","twitter_card":"summary_large_image","twitter_misc":{"Written by":"yellowweb","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/#article","isPartOf":{"@id":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/"},"author":{"name":"yellowweb","@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829"},"headline":"MD5 di PHP","datePublished":"2017-06-02T06:45:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/"},"wordCount":101,"image":{"@id":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/06\/md5-php.jpg","keywords":["enkripsi","hak akses","md5","password","php","programming"],"articleSection":["PHP","Tutorial"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/","url":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/","name":"MD5 di PHP - YELLOWWEB.ID","isPartOf":{"@id":"https:\/\/www.yellowweb.id\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/#primaryimage"},"image":{"@id":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/06\/md5-php.jpg","datePublished":"2017-06-02T06:45:34+00:00","author":{"@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829"},"breadcrumb":{"@id":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.yellowweb.id\/blog\/md5-di-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/#primaryimage","url":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/06\/md5-php.jpg","contentUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2017\/06\/md5-php.jpg","width":750,"height":350,"caption":"md5-php"},{"@type":"BreadcrumbList","@id":"https:\/\/www.yellowweb.id\/blog\/md5-di-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.yellowweb.id\/blog\/"},{"@type":"ListItem","position":2,"name":"MD5 di PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.yellowweb.id\/blog\/#website","url":"https:\/\/www.yellowweb.id\/blog\/","name":"YELLOWWEB.ID","description":"Kursus Web Design | Kursus Web Programming | Mobile Web Apps | Digital Marketing","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.yellowweb.id\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829","name":"yellowweb","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","caption":"yellowweb"},"sameAs":["https:\/\/www.yellowweb.id"],"url":"https:\/\/www.yellowweb.id\/blog\/author\/yellowweb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/comments?post=636"}],"version-history":[{"count":4,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/636\/revisions"}],"predecessor-version":[{"id":640,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/636\/revisions\/640"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/media\/641"}],"wp:attachment":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/media?parent=636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/categories?post=636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/tags?post=636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}