{"id":149841,"date":"2018-11-02T15:29:52","date_gmt":"2018-11-02T15:29:52","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=149841"},"modified":"2018-11-02T15:37:58","modified_gmt":"2018-11-02T15:37:58","slug":"decrypting-md5","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/decrypting-md5\/","title":{"rendered":"Decrypting MD5 hashes by Reverse Lookup\/Brute Force"},"content":{"rendered":"<p>As all of us already knows that MD5 (message digest) is one-way digest algorithm. It means we can&#8217;t get the original string back once it gets digested\/hashed. Really&#8230;?<\/p>\n<h3>Can we decrypt the md5ed hashes?\u00a0 \u00a0 \u00a0ummm&#8230;.. Yes!<\/h3>\n<h5>Let&#8217;s see how to get back the original string from the md5 hashes.<\/h5>\n<p>It is a very straightforward approach to get back the original string from the MD5ed hash known as Reverse Lookup. (aka brute-force)<\/p>\n<p>As MD5 always generate the same hashed key for the same input string.<\/p>\n<p>If we create a mapped database between original string and md5ed hashed key of the strings(all possible characters of the desired length of string and their permutations) as shown in the below table. Then, at last, we will have a database of all the possible strings and their relative hashed keys.<\/p>\n<p>Now, if we want to know the original string from md5 hashed key then we search the database for that hash key instead of the original string<\/p>\n<p>For example:<\/p>\n<p>&nbsp;<\/p>\n<table style=\"height: 160px\" width=\"540\">\n<tbody>\n<tr>\n<th>hash_key<\/th>\n<th>original_string<\/th>\n<\/tr>\n<tr>\n<td style=\"text-align: center\">02ffa6505a9717c36292cd9bf76972fc<\/td>\n<td style=\"text-align: center\">qwerty@12345<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center\">6d0952a65f2fcf9fa553a8956414e596<\/td>\n<td style=\"text-align: center\">md5decrypt<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center\">f68e2a0caa1d7bc2d30ddcb5db33e9d4<\/td>\n<td style=\"text-align: center\">simplep@ssw0rd<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center\">c633a43739df88f9280e89d001ed69e9<\/td>\n<td style=\"text-align: center\">anycommonstring<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>If we create a database of all possible original string by permutating their character sequence. Then finally, we will have the hash key of every string. So, we can search for any particular\u00a0hash key to decrypt.<\/p>\n<p>Since it will take a lot of computation and also a lot of storage to maintain this mapped database, Instead of that we can use the online md5 decrypting website like\u00a0<a style=\"color: blue\" href=\"https:\/\/md5decrypt.net\/en\/\" target=\"_blank\" rel=\"noopener\">md5decrypt.net<\/a>\u00a0based on the same technique.<\/p>\n<p>&nbsp;<\/p>\n<h3>Now the question arises, Is MD5 secure enough to use in the process of storing any important data such as password, OTP etc?<\/h3>\n<p>Yes, but with the appropriate salt, Using the md5 for storing critical data\u00a0such as password and OTP in the database without appropriate\u00a0<a style=\"color: blue\" href=\"https:\/\/en.wikipedia.org\/wiki\/Salt_(cryptography)\" target=\"_blank\" rel=\"noopener\">salt<\/a>\u00a0is not recommendable and md5 should not be used without salt because:<\/p>\n<ul>\n<li>md5 doesn&#8217;t have any internal salt creation mechanism as some other hashing algorithm such as BCrypt(based on Blowfish Cipher) has.<\/li>\n<li>it is very easy to get the original string (password\/OTP) from the md5 hashed key for simple password or OTP<\/li>\n<\/ul>\n<p><strong>How salt plays its role:<\/strong><\/p>\n<p>MD5 is a hashing function it means we are using it where we have to authenticate something in future and also at that point we are not interested in the original string while authenticating. We only want to confirm that the current string(user entered value) is the same string for which we stored the hashed key. Means we are hashing again the user entered password\/OTP and matching it against the stored hashed key.<\/p>\n<p>So we can use a strong salt and append it to the original string while creating the hash key to store in the database, Eg:<\/p>\n<p><em><strong>$hashedKey = md5(_SALT1_.$password._SALT2_);<\/strong> \/\/ save this\u00a0$hashedKey in the database<\/em><\/p>\n<p>Next time when the user enters his password then use the same salt to create the hash\u00a0and check it against the stored hashed key.<\/p>\n<p>Try to make longer salts so that it will be so difficult to break the resulted hash key by brute-force.<\/p>\n<p>Also If you are <strong>not<\/strong> working on the open-source platform\/product\/software. Then, you can use your logic to make it unbreakable for the hacker to get the real password\/OTP. (Even after getting the database hacked) Eg:<\/p>\n<p><em><strong>$hashedKey = md5(_SALT1_.($otp*2.5)._SALT2_);<\/strong> \/\/ save this\u00a0$hashedKey in the database and use the same process to create hash while authenticating<\/em><\/p>\n<p>Thanks for Reading!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As all of us already knows that MD5 (message digest) is one-way digest algorithm. It means we can&#8217;t get the original string back once it gets digested\/hashed. Really&#8230;? Can we decrypt the md5ed hashes?\u00a0 \u00a0 \u00a0ummm&#8230;.. Yes! Let&#8217;s see how to get back the original string from the md5 hashes. It is a very straightforward <a href=\"https:\/\/webkul.com\/blog\/decrypting-md5\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":228,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[7772,7770,7771,7777,7776,7769,7774,7775,7773],"class_list":["post-149841","post","type-post","status-publish","format-standard","hentry","category-php","tag-brute-force","tag-decrypt-md5","tag-decrypt-md5-hash","tag-decrypting-md5","tag-decrypting-md5-hash","tag-md5","tag-md5-brute-force","tag-md5-reverse-lookup","tag-reverse-lookup"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Decrypting MD5 hashes by Reverse Lookup\/Brute Force - Webkul Blog<\/title>\n<meta name=\"description\" content=\"If we create a mapped database between all the possible strings and their md5 hashes so we&#039;ll have database of hashes and related string.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/decrypting-md5\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Decrypting MD5 hashes by Reverse Lookup\/Brute Force - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"If we create a mapped database between all the possible strings and their md5 hashes so we&#039;ll have database of hashes and related string.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/decrypting-md5\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-02T15:29:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-02T15:37:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Suraj Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Suraj Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/decrypting-md5\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/decrypting-md5\/\"},\"author\":{\"name\":\"Suraj Kumar\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/ee7f6c8596b1c41c1fff62772bc054d1\"},\"headline\":\"Decrypting MD5 hashes by Reverse Lookup\/Brute Force\",\"datePublished\":\"2018-11-02T15:29:52+00:00\",\"dateModified\":\"2018-11-02T15:37:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/decrypting-md5\/\"},\"wordCount\":623,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"brute force\",\"decrypt md5\",\"decrypt md5 hash\",\"decrypting md5\",\"decrypting md5 hash\",\"md5\",\"md5 brute force\",\"md5 reverse lookup\",\"reverse lookup\"],\"articleSection\":[\"php\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/decrypting-md5\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/decrypting-md5\/\",\"url\":\"https:\/\/webkul.com\/blog\/decrypting-md5\/\",\"name\":\"Decrypting MD5 hashes by Reverse Lookup\/Brute Force - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2018-11-02T15:29:52+00:00\",\"dateModified\":\"2018-11-02T15:37:58+00:00\",\"description\":\"If we create a mapped database between all the possible strings and their md5 hashes so we'll have database of hashes and related string.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/decrypting-md5\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/decrypting-md5\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/decrypting-md5\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Decrypting MD5 hashes by Reverse Lookup\/Brute Force\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/ee7f6c8596b1c41c1fff62772bc054d1\",\"name\":\"Suraj Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/365246c49147a2d3fab3393fea10df2b5504db6a232ffe710da3a7e208dab3b3?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/365246c49147a2d3fab3393fea10df2b5504db6a232ffe710da3a7e208dab3b3?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Suraj Kumar\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/suraj2-kumar456\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Decrypting MD5 hashes by Reverse Lookup\/Brute Force - Webkul Blog","description":"If we create a mapped database between all the possible strings and their md5 hashes so we'll have database of hashes and related string.","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:\/\/webkul.com\/blog\/decrypting-md5\/","og_locale":"en_US","og_type":"article","og_title":"Decrypting MD5 hashes by Reverse Lookup\/Brute Force - Webkul Blog","og_description":"If we create a mapped database between all the possible strings and their md5 hashes so we'll have database of hashes and related string.","og_url":"https:\/\/webkul.com\/blog\/decrypting-md5\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2018-11-02T15:29:52+00:00","article_modified_time":"2018-11-02T15:37:58+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Suraj Kumar","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Suraj Kumar","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/decrypting-md5\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/decrypting-md5\/"},"author":{"name":"Suraj Kumar","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/ee7f6c8596b1c41c1fff62772bc054d1"},"headline":"Decrypting MD5 hashes by Reverse Lookup\/Brute Force","datePublished":"2018-11-02T15:29:52+00:00","dateModified":"2018-11-02T15:37:58+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/decrypting-md5\/"},"wordCount":623,"commentCount":7,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["brute force","decrypt md5","decrypt md5 hash","decrypting md5","decrypting md5 hash","md5","md5 brute force","md5 reverse lookup","reverse lookup"],"articleSection":["php"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/decrypting-md5\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/decrypting-md5\/","url":"https:\/\/webkul.com\/blog\/decrypting-md5\/","name":"Decrypting MD5 hashes by Reverse Lookup\/Brute Force - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2018-11-02T15:29:52+00:00","dateModified":"2018-11-02T15:37:58+00:00","description":"If we create a mapped database between all the possible strings and their md5 hashes so we'll have database of hashes and related string.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/decrypting-md5\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/decrypting-md5\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/decrypting-md5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Decrypting MD5 hashes by Reverse Lookup\/Brute Force"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/ee7f6c8596b1c41c1fff62772bc054d1","name":"Suraj Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/365246c49147a2d3fab3393fea10df2b5504db6a232ffe710da3a7e208dab3b3?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/365246c49147a2d3fab3393fea10df2b5504db6a232ffe710da3a7e208dab3b3?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Suraj Kumar"},"url":"https:\/\/webkul.com\/blog\/author\/suraj2-kumar456\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/149841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/228"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=149841"}],"version-history":[{"count":17,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/149841\/revisions"}],"predecessor-version":[{"id":150504,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/149841\/revisions\/150504"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=149841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=149841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=149841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}