{"id":2805,"date":"2024-10-22T10:19:45","date_gmt":"2024-10-22T10:19:45","guid":{"rendered":"https:\/\/apex-aiexperts.com\/?p=2805"},"modified":"2024-10-22T10:19:45","modified_gmt":"2024-10-22T10:19:45","slug":"what-is-hashing-used-for","status":"publish","type":"post","link":"https:\/\/apex-aiexperts.com\/es\/what-is-hashing-used-for\/","title":{"rendered":"What Is Hashing Used For?"},"content":{"rendered":"<p class=\"wp-block-paragraph\">The main purpose of hashing is to&nbsp;<strong>verify the integrity of a piece of data<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the hash generated is UNIQUE to the input data, it acts as a unique \u201c<strong>fingerprint<\/strong>\u201d of the input data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This makes a hash useful for verifying the integrity of data sent through insecure communication channels like the internet.&nbsp;<strong>Data integrity just means that the data has not been altered in an unapproved way.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The hash value of received data can be compared to the hash value of data&nbsp;<em>before<\/em>&nbsp;it was sent to determine whether the data was altered.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If I post both the message and the hash value I generated from it, you can generate a hash value from the message that you received and compare the hash values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using a very&nbsp;<em>simple<\/em>&nbsp;example, let\u2019s say we\u2019re about to meet up for lunch, and right before I head out the door, I remember our last time together\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/bpcdn.co\/images\/2022\/06\/13144008\/body-odor-360x360.png\" alt=\"Body odor\" class=\"wp-image-225432\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">While your personality was really nice, your smell was not nice at all.&nbsp;<img decoding=\"async\" alt=\"\ud83d\ude2c\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/15.0.3\/svg\/1f62c.svg\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So I want to send you a message, \u201c<strong>Please wear deodorant.<\/strong>\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But before I send this, I run it through a hash function (SHA-256). The hash is:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>33ebb528eab107766343d0ac591952bb68ee959d45b7a8b399628e662f3bc1ef<\/strong><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I send you this hash&nbsp;<em>first<\/em>.*<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">THEN I send you the actual text message.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you receive my message, you think, \u201cWTF? Did he really just say that to me? Or was the message intercepted during transit and the original message was altered?\u201d<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/bpcdn.co\/images\/2022\/06\/06223327\/armpit.png\" alt=\"Armpit stinks\" class=\"wp-image-225150\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So you run the message through the&nbsp;<strong>same hash function<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>33ebb528eab107766343d0ac591952bb68ee959d45b7a8b399628e662f3bc1ef<\/strong><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You then compare your hash versus the hash that came before the text message.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If both hash values are the same, then this proves that:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The message was sent correctly.<\/li>\n\n\n\n<li>That your armpits really do stink!<\/li>\n\n\n\n<li>The message has not been deliberately altered by someone between me sending it to you and you receiving it.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Of course, in the real world, it is our&nbsp;<strong>ordenadores<\/strong>&nbsp;that do all this for us.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And hopefully, you keep your armpits smelling fresh.&nbsp;<img decoding=\"async\" alt=\"\ud83d\ude05\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/15.0.3\/svg\/1f605.svg\"><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">*Technically, before I send you the hash, it should be protected in some way, but I wanted to keep the example simple. How the hash stays protected during transit will be covered in a later lesson.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Real-World Example of Hashing: Online Passwords<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This might surprise you, but you probably encounter hashing in your daily life\u2026.whenever you log in to check your email.&nbsp;<img decoding=\"async\" alt=\"\ud83d\udce7\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/15.0.3\/svg\/1f4e7.svg\"><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/bpcdn.co\/images\/2022\/08\/11125628\/use-hashsing-to-login-email-284x360.png\" alt=\"Email uses hashing\" class=\"wp-image-228636\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When you create an email address and password, your email provider likely does not save your actual password.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead, your email provider runs the password through a hash function and&nbsp;<strong>saves the&nbsp;<em>hash<\/em>&nbsp;of your password<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every time you attempt to log in to your email account, your email provider&nbsp;<strong>hashes the password YOU enter<\/strong>&nbsp;y&nbsp;<em>compares<\/em>&nbsp;this hash to the hash it has saved.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Only&nbsp;<strong>when the two hashes match<\/strong>&nbsp;are you authorized to access your email.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s see why they do NOT save your actual password\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/bpcdn.co\/images\/2022\/02\/14164945\/hashing-password-1.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/bpcdn.co\/images\/2022\/02\/14164945\/hashing-password-1.png\" alt=\"Password in Plaintext\" class=\"wp-image-219050\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If actual passwords are stored, and hackers get into their system, they can steal them. This is definitely not good for users who use the same password for multiple websites!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A solution is to hash the password\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/bpcdn.co\/images\/2022\/02\/14165031\/hashing-password-2.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/bpcdn.co\/images\/2022\/02\/14165031\/hashing-password-2.png\" alt=\"Hash Pasword\" class=\"wp-image-219051\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">By hashing a password, the company protects user information. Even if a hacker breaks into the system, they won\u2019t have access to actual passwords, just the hashes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remember, hashes are&nbsp;<strong>irreversible<\/strong>&nbsp;so it\u2019s impossible for the hacker to figure out what the actual password is just by looking at the hash. Hashing ensures that the data is stored in a scrambled state, so it\u2019s harder to steal.<br><a href=\"https:\/\/bpcdn.co\/images\/2022\/02\/14165134\/hashing-password-3.png\" rel=\"noreferrer noopener\" target=\"_blank\"><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whenever you log in, your email provider doesn\u2019t store the plain text password, all they need is the&nbsp;<strong>hash<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you enter your password, it is run through the hash function.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The output is matched against the hash that is saved in the database.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the hash values are the same, the password is correct.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The wrong password entered would produce a different hash<\/strong>&nbsp;than the one saved. The hashes would NOT match, so your login attempt would FAIL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So as you can see, a hash function&nbsp;<strong>garbles data and makes it unreadable<\/strong>. Even if a hacker gains access to your email provider\u2019s server, the details stored can\u2019t be unscrambled.<\/p>","protected":false},"excerpt":{"rendered":"<p>The main purpose of hashing is to&nbsp;verify the integrity of a piece of data. Since the hash generated is UNIQUE to the input data, it acts as a unique \u201cfingerprint\u201d of the input data. This makes a hash useful for verifying the integrity of data sent through insecure communication channels like the internet.&nbsp;Data integrity just [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,12],"tags":[],"class_list":["post-2805","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\/2805","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=2805"}],"version-history":[{"count":1,"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/posts\/2805\/revisions"}],"predecessor-version":[{"id":2806,"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/posts\/2805\/revisions\/2806"}],"wp:attachment":[{"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/media?parent=2805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/categories?post=2805"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/apex-aiexperts.com\/es\/wp-json\/wp\/v2\/tags?post=2805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}