{"id":2801,"date":"2024-10-22T10:12:53","date_gmt":"2024-10-22T10:12:53","guid":{"rendered":"https:\/\/apex-aiexperts.com\/?p=2801"},"modified":"2024-10-22T10:12:53","modified_gmt":"2024-10-22T10:12:53","slug":"how-does-hashing-work","status":"publish","type":"post","link":"https:\/\/apex-aiexperts.com\/es\/how-does-hashing-work\/","title":{"rendered":"How Does Hashing Work?"},"content":{"rendered":"<p class=\"wp-block-paragraph\">In the&nbsp;<a href=\"https:\/\/tradecenterfx.com\/beginners-guide-to-hashing\/how-does-hashing-work\/#\" target=\"_blank\" rel=\"noreferrer noopener\">lecci\u00f3n anterior<\/a>, I introduced the concept of hashing and relevant terms. Now, let\u2019s learn how it works!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hashing is a mathematical operation that is&nbsp;<strong>easy to perform<\/strong>, but&nbsp;<strong>extremely difficult to reverse<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The hashing process turns a piece of data into binary code, which is just a&nbsp;<strong>bunch of 0s and 1s<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then it breaks up the numbers and applies some secret \u201c<strong>jumbling\u201d<\/strong>, which is done by something called the \u201chash function\u201d.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How does hashing work in crypto?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When used in Bitcoin and other cryptocurrencies, the end result is typically a&nbsp;<strong>64-digit long string of numbers and letters<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because the conversion is done by a cryptographic algorithm (the \u201chash function\u201d), the jumbling formula is unknown so the 64-digit string can\u2019t be reversed.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/bpcdn.co\/images\/2022\/02\/14154523\/hashing-concept.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/bpcdn.co\/images\/2022\/02\/14154523\/hashing-concept.png\" alt=\"Hashing Concept\" class=\"wp-image-219029\" title=\"Hashing Concept\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A&nbsp;<strong>string&nbsp;<\/strong>is a sequence of characters.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Strings are like sentences. They are formed by a combination of characters.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/bpcdn.co\/images\/2022\/02\/14154836\/hashing-string.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/bpcdn.co\/images\/2022\/02\/14154836\/hashing-string.png\" alt=\"String\" class=\"wp-image-219031\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Think of a hash as a bunch of&nbsp;<strong>random letters and numbers<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A unique piece of data will always produce the&nbsp;<strong>same hash<\/strong>.<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For example, every time the string above is run through the hash function, it will&nbsp;<strong>always<\/strong>&nbsp;produce the same hash.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But what happens if we make just a&nbsp;<strong>tiny change<\/strong>&nbsp;to the string? (Highlighted in yellow.)<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/bpcdn.co\/images\/2022\/02\/14155150\/hashing-string-slight-change.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/bpcdn.co\/images\/2022\/02\/14155150\/hashing-string-slight-change.png\" alt=\"String Change\" class=\"wp-image-219032\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The sentence ends with a&nbsp;<strong>question mark<\/strong>&nbsp;instead of a period.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Even though it was a TINY change in the sentence, the hash is TOTALLY different.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can see how using hashes can be used to&nbsp;<strong>detect tampering<\/strong>&nbsp;since even a small change to that input to the hash function results in a totally different output.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s very important you remember this point because, in a later lesson, you\u2019ll see how this is used to prevent previous transactions from being tampered with.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The hash function is ONE-WAY only.<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/bpcdn.co\/images\/2022\/02\/14155714\/hashing-one-way-function.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/bpcdn.co\/images\/2022\/02\/14155714\/hashing-one-way-function.png\" alt=\"The hash function is ONE-WAY only. \" class=\"wp-image-219033\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can\u2019t take an existing hash and try to reverse it to find the input string.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So if all you know is the hash,&nbsp;<strong>there\u2019s no way to know what the original input is<\/strong>. You can\u2019t \u201creverse engineer\u201d or hack the hash.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Lastly, the&nbsp;<strong>length<\/strong>&nbsp;of the output (the \u201chash\u201d) does NOT grow with an increase in information in the input. A hash function takes input data of ANY length and returns a value that has a FIXED length.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/bpcdn.co\/images\/2022\/02\/14155918\/hashing-harry-potter.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/bpcdn.co\/images\/2022\/02\/14155918\/hashing-harry-potter.png\" alt=\"Hash Output is Fixed\" class=\"wp-image-219034\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If you put the entire text of a Harry Potter book, which has over 76,000 words, the hash output will STILL only be 64 characters long.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And again, if you misspell&nbsp;<strong>even a single letter&nbsp;<\/strong>in the Harry Potter book, and ran it through the hash function,&nbsp; it would produce a&nbsp;<strong>totally different hash<\/strong>&nbsp;from above.<\/p>","protected":false},"excerpt":{"rendered":"<p>In the&nbsp;previous lesson, I introduced the concept of hashing and relevant terms. Now, let\u2019s learn how it works! Hashing is a mathematical operation that is&nbsp;easy to perform, but&nbsp;extremely difficult to reverse. The hashing process turns a piece of data into binary code, which is just a&nbsp;bunch of 0s and 1s. Then it breaks up the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,12],"tags":[],"class_list":["post-2801","post","type-post","status-publish","format-standard","hentry","category-beginners-guide-to-hashing","category-learn-crypto"],"_links":{"self":[{"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/posts\/2801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/comments?post=2801"}],"version-history":[{"count":1,"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/posts\/2801\/revisions"}],"predecessor-version":[{"id":2802,"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/posts\/2801\/revisions\/2802"}],"wp:attachment":[{"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/media?parent=2801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/categories?post=2801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/tags?post=2801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}