{"id":1826,"date":"2020-08-06T13:20:00","date_gmt":"2020-08-06T10:20:00","guid":{"rendered":"https:\/\/www.virtono.com\/community\/?p=1826"},"modified":"2020-08-05T11:43:03","modified_gmt":"2020-08-05T08:43:03","slug":"what-you-absolutely-must-know-about-hash-functions","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/knowledgebase\/what-you-absolutely-must-know-about-hash-functions\/","title":{"rendered":"What you absolutely must know about Hash Functions"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>How or Why are your passwords stored using Hash, ever wondered?<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">I believe having a working knowledge of cryptographic hash functions is a must to everyone. Even though they are primarily used by security practitioners. You must hear the words often or even use them without realizing it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I will be honest with you, these things come off as boring to everyday users that is unfortunately the reason why we read the term hashing but don\u2019t dive into what&#8217;s happening behind the scenes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is why I will try to make this one interesting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s talk data, data could be of any size. Open up your terminal and we will create hashes for multiple strings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will use MD5 hashing algorithm, more info on that later.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.virtono.com\/community\/knowledgebase\/what-you-absolutely-must-know-about-hash-functions\/#Fire_up_your_terminal\" title=\"Fire up your terminal:\">Fire up your terminal:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.virtono.com\/community\/knowledgebase\/what-you-absolutely-must-know-about-hash-functions\/#Things_we_just_did_and_what_to_pick_up_from_it\" title=\"Things we just did and what to pick up from it:\">Things we just did and what to pick up from it:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.virtono.com\/community\/knowledgebase\/what-you-absolutely-must-know-about-hash-functions\/#We_can_generate_hashes_now_using_MD5_for_some_strings_but_where_do_I_use_this_whats_the_purpose\" title=\"We can generate hashes now using MD5 for some strings, but where do I use this, what\u2019s the purpose?\">We can generate hashes now using MD5 for some strings, but where do I use this, what\u2019s the purpose?<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Fire_up_your_terminal\"><\/span>Fire up your terminal:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>md5sum &lt;&lt;&lt; \u201cyour_string\u201d<\/p><\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1829\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/what-you-absolutely-must-know-about-hash-functions\/attachment\/image-2-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-2.png?fit=423%2C68&amp;ssl=1\" data-orig-size=\"423,68\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-2.png?fit=423%2C68&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-2.png?resize=495%2C80&#038;ssl=1\" alt=\"\" class=\"wp-image-1829\" width=\"495\" height=\"80\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-2.png?w=423&amp;ssl=1 423w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-2.png?resize=300%2C48&amp;ssl=1 300w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now let\u2019s use one character<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>md5sum &lt;&lt;&lt; \u201cs\u201d<\/p><\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1828\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/what-you-absolutely-must-know-about-hash-functions\/attachment\/image-1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-1.png?fit=372%2C73&amp;ssl=1\" data-orig-size=\"372,73\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-1.png?fit=372%2C73&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-1.png?resize=438%2C86&#038;ssl=1\" alt=\"\" class=\"wp-image-1828\" width=\"438\" height=\"86\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-1.png?w=372&amp;ssl=1 372w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-1.png?resize=300%2C59&amp;ssl=1 300w\" sizes=\"auto, (max-width: 438px) 100vw, 438px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And now for my final trick, lets take a huge string<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>md5sum &lt;&lt;&lt;\u201dhuge_string\u201d<\/p><\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"95\" data-attachment-id=\"1830\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/what-you-absolutely-must-know-about-hash-functions\/attachment\/image-3-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-3.png?fit=602%2C95&amp;ssl=1\" data-orig-size=\"602,95\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-3.png?fit=602%2C95&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-3.png?resize=602%2C95&#038;ssl=1\" alt=\"\" class=\"wp-image-1830\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-3.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-3.png?resize=300%2C47&amp;ssl=1 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Things_we_just_did_and_what_to_pick_up_from_it\"><\/span>Things we just did and what to pick up from it:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1 . Fixed Size:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What we did just now is created multiple 128-bit hash value of multiple input strings that were different in sizes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A cryptographic hash function, such as SHA-256 or MD5, takes as input a set of binary data (typically as bytes) and gives output \u2014&#8221;the hash&#8221;\/\u201dmessage digest\u201d\u2014for any particular hash function is typically the same for any pattern of inputs<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Uniqueness : All the hashes generated were unique.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We always expect that the output that is provided is hopefully unique for each set of possible inputs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Important point to note here is that in the example we used MD5 which is no longer used by security practitioners, as it is severely compromised.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Deterministic<\/strong>, this means that we should get the same hash with the same method and same input.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1831\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/what-you-absolutely-must-know-about-hash-functions\/attachment\/image-4-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-4.png?fit=417%2C108&amp;ssl=1\" data-orig-size=\"417,108\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-4\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-4.png?fit=417%2C108&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-4.png?resize=494%2C128&#038;ssl=1\" alt=\"\" class=\"wp-image-1831\" width=\"494\" height=\"128\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-4.png?w=417&amp;ssl=1 417w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-4.png?resize=300%2C78&amp;ssl=1 300w\" sizes=\"auto, (max-width: 494px) 100vw, 494px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see MD5 for \u201csame_test\u201d produces the same hash.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Preimage Resistance<\/strong>, just a fancy term which means, it should be computationally infeasible to work backward from the output hash to the input. This is why they are sometimes referred to as one-way hash functions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5.<\/strong> <strong>Second preimage resistance<\/strong>, another fancy term lads. It relates to the property of a hash-function that it should be infeasible to find two different messages with the same hash value.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>6. Avalanche effect,<\/strong> one small change for an input, one giant change for the hash generated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A small change to a message should change the hash value so extensively that the new hash value appears uncorrelated with the old hash value.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Lets put this to test:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1832\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/what-you-absolutely-must-know-about-hash-functions\/attachment\/image-5-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-5.png?fit=412%2C107&amp;ssl=1\" data-orig-size=\"412,107\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-5\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-5.png?fit=412%2C107&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-5.png?resize=489%2C127&#038;ssl=1\" alt=\"\" class=\"wp-image-1832\" width=\"489\" height=\"127\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-5.png?w=412&amp;ssl=1 412w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-5.png?resize=300%2C78&amp;ssl=1 300w\" sizes=\"auto, (max-width: 489px) 100vw, 489px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Two inputs : \u201cshreyash&#8221;, \u201cshreyass\u201d. Vastly different hashes generated<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"We_can_generate_hashes_now_using_MD5_for_some_strings_but_where_do_I_use_this_whats_the_purpose\"><\/span>We can generate hashes now using MD5 for some strings, but where do I use this, what\u2019s the purpose?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1833\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/what-you-absolutely-must-know-about-hash-functions\/attachment\/image-6-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-6.png?fit=400%2C598&amp;ssl=1\" data-orig-size=\"400,598\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-6\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-6.png?fit=400%2C598&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-6.png?resize=497%2C743&#038;ssl=1\" alt=\"\" class=\"wp-image-1833\" width=\"497\" height=\"743\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-6.png?w=400&amp;ssl=1 400w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/image-6.png?resize=201%2C300&amp;ssl=1 201w\" sizes=\"auto, (max-width: 497px) 100vw, 497px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The two most important uses for Hash Functions are <strong>Password Storage<\/strong> and <strong>Data Integrity Check.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When using cryptographic hash functions we are always hopeful that the hash generated are unique. Should two inputs yield the same output, the hash is said to have a &#8220;collision.&#8221; In fact, MD5 has become deprecated because it is now easily possible to find collisions. A collision attack exists that can find collisions within seconds on a computer with a 2.6 GHz Pentium 4 processor.[<a rel=\"noreferrer noopener\" href=\"https:\/\/www.win.tue.nl\/hashclash\/On%20Collisions%20for%20MD5%20-%20M.M.J.%20Stevens.pdf\" target=\"_blank\">Link<\/a>]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can say that without uniqueness, the technology is rendered useless, at least for the purpose you generally have for it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Password Storage:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If a database is storing your ID and Password in a key value pair, which it needs to in order to authenticate you. The database should never store the password in clear text, at the very least that password\u2019s hash is stored.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As we discussed Preimage Resistance, it comes in full effect here.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If ever so the database is exposed, the attacker will only see the hash of your password stored. He can neither logon using hash nor can he derive the password from hash value since hash function possesses the property of pre-image resistance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Data Integrity Check:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another common application is data integrity check. This is to make sure that the piece of binary data that you were handed is the correct binary data that the sender intended you to have.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This data could be a text, excel a whole damn movie of several Gigabytes. Did your mind just twitch a bit?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">How in the world are you going to compare several Gigabytes of binary data, it is slow, cumbersome and you just wanna watch your movie.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Given two files several megabytes or gigabytes in size, you can produce hashes of them ahead of time and defer the comparisons to when you need them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is also easier to digitally sign hashes of data rather than large sets of data themselves. This is such an important feature that one of the most common uses of hashes in cryptography is to generate &#8220;digital&#8221; signatures.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore you do not even require both the files, the file\u2019s and its hash is sufficient to check the integrity.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, you will have to be sure of the origin of both, the file and the hash. In case there is a MITM attack for example, the attacker can modify the file and create a new hash for the modified file send it to you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore you have to be sure of the origin of both.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How or Why are your passwords stored using Hash, ever wondered? I believe having a working knowledge of cryptographic hash functions is a must to everyone. Even though they are primarily used by security practitioners. You must hear the words often or even use them without realizing it. I will<\/p>\n","protected":false},"author":4,"featured_media":1835,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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},"jetpack_post_was_ever_published":false},"categories":[5],"tags":[78,79,80],"class_list":["post-1826","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledgebase","tag-hash","tag-md5","tag-sha256"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2020\/08\/645055-637286229929045712-16x9-1.jpg?fit=1920%2C1080&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-ts","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":287,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/mysql-top-10-design-tips\/","url_meta":{"origin":1826,"position":0},"title":"MySQL: Top 10 Design Tips","author":"Daniel Draga","date":"August 7, 2016","format":false,"excerpt":"This article is a fraction of a Number of Articles on MySQL, to access them click here. \u00a0\u00a0\u00a0\u00a0\u00a0 1.Understand Your Technology Tools MySQL is great platform to manage your database, and to be able to understand every aspect is not that easy, but the one thing that we can do\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL_Replication1-2.png?fit=965%2C687&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL_Replication1-2.png?fit=965%2C687&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL_Replication1-2.png?fit=965%2C687&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/08\/MySQL_Replication1-2.png?fit=965%2C687&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":984,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/malware-detection-on-your-server\/","url_meta":{"origin":1826,"position":1},"title":"Malware Detection On Your Server","author":"Daniel Draga","date":"June 26, 2017","format":false,"excerpt":"The term malware encompasses a large range of unwelcome software that is designed to damage a computer. A partial list of malware might, for example, include viruses, spyware, Trojan horses, and worms. The rapid proliferation of such software is enough to concern users of all levels, from novices to seasoned\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/What-is-Malware.jpg?fit=600%2C300&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/What-is-Malware.jpg?fit=600%2C300&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/What-is-Malware.jpg?fit=600%2C300&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":1223,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/create-your-own-apt-repository-with-reprepro-on-ubuntu\/","url_meta":{"origin":1826,"position":2},"title":"Create your own apt repository with reprepro on Ubuntu","author":"Shreyash Sharma","date":"November 2, 2017","format":false,"excerpt":"With\u00a0reprepro\u00a0simple own\u00a0package repositories\u00a0can be created and managed.\u00a0The tool is located in the Ubuntu repositories and can be used to provide\u00a0your own packages\u00a0or to mirror existing repositories.\u00a0This article introduces reprepro and shows the structure of a simple repos on\u00a0Ubuntu Server.\u00a0For situations where complete repositories should be mirrored for deployment in their\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/11\/deploying-with-super-cow-powers-hosting-your-own-apt-repository-with-reprepro-8-638.jpg?fit=638%2C479&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/11\/deploying-with-super-cow-powers-hosting-your-own-apt-repository-with-reprepro-8-638.jpg?fit=638%2C479&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/11\/deploying-with-super-cow-powers-hosting-your-own-apt-repository-with-reprepro-8-638.jpg?fit=638%2C479&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":732,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/hardening-the-defense-of-database-server\/","url_meta":{"origin":1826,"position":3},"title":"Hardening the Defense of Database Server","author":"Daniel Draga","date":"November 1, 2016","format":false,"excerpt":"Importance of Database Security: Databases often store sensitive data Incorrect data or loss of data could negatively affect business operations Databases can be used as bases to attack other systems from. \u00a0 Principles of Finding Holes Don't believe the documentation Implement your own client Debug the system to understand how\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/11\/network-security1.jpg?fit=1200%2C556&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/11\/network-security1.jpg?fit=1200%2C556&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/11\/network-security1.jpg?fit=1200%2C556&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/11\/network-security1.jpg?fit=1200%2C556&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2016\/11\/network-security1.jpg?fit=1200%2C556&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":988,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/digitally-fingerprint-your-files\/","url_meta":{"origin":1826,"position":4},"title":"Digitally Fingerprint Your Files","author":"Daniel Draga","date":"June 26, 2017","format":false,"excerpt":"There are a number of good reasons to keep an eye on your server security. Few sysadmin types absorb the necessary security knowledge required to keep their infrastructure safe without enthusiasm and effort. If you\u2019re anything like me, there have been a few bumps along the way, such as when\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/digital_fingerprint_0.jpg?fit=370%2C370&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1124,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/installing-zabbix-3-0-on-ubuntu-16-04-with-postgresql\/","url_meta":{"origin":1826,"position":5},"title":"Installing zabbix 3.0 on Ubuntu 16.04 with PostgreSQL","author":"Shreyash Sharma","date":"October 15, 2017","format":false,"excerpt":"A few days ago I installed Zabbix 3.0 under Ubuntu 16.04.\u00a0Since I would like to deal with PostgreSQL, I decided to use it as a database. installation The first release of Zabbix's release package is the following: 1 wget http:\/\/repo.zabbix.com\/zabbix\/3.0\/ubuntu\/pool\/main\/z\/zabbix-release\/zabbix-release_3.0-1+xenial_all.deb which is then installed 1 dpkg -i zabbix-release_3.0-1+xenial_all.deb So now\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/1826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=1826"}],"version-history":[{"count":1,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/1826\/revisions"}],"predecessor-version":[{"id":1834,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/1826\/revisions\/1834"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/1835"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=1826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=1826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=1826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}