<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: noted</title>
    <description>The latest articles on DEV Community by noted (@notedbyneosahadeo).</description>
    <link>https://dev.to/notedbyneosahadeo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F9110%2F029a0e6e-c33c-4e57-ad35-d2690463cff0.png</url>
      <title>DEV Community: noted</title>
      <link>https://dev.to/notedbyneosahadeo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/notedbyneosahadeo"/>
    <language>en</language>
    <item>
      <title>Salting &amp; Hashing🍳</title>
      <dc:creator>Neo Sahadeo</dc:creator>
      <pubDate>Thu, 11 Jul 2024 13:07:32 +0000</pubDate>
      <link>https://dev.to/notedbyneosahadeo/salting-hashing-21ge</link>
      <guid>https://dev.to/notedbyneosahadeo/salting-hashing-21ge</guid>
      <description>&lt;h2&gt;
  
  
  What is salting 🧂?
&lt;/h2&gt;

&lt;p&gt;Salting is the process of adding data into a value before &lt;strong&gt;hashing&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is hashing #️⃣?
&lt;/h2&gt;

&lt;p&gt;Hashing is the process of converting data into a &lt;em&gt;fixed-length&lt;/em&gt; string.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;fixed-length: all hashes will have the same length&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;⚠️Something important to highlight is that &lt;strong&gt;hashing is not encrypting&lt;/strong&gt;; Hashing or encryption depends on what the ultimate goal of that obfuscation is (orginisation regulations are a factor).&lt;/p&gt;

&lt;h3&gt;
  
  
  Here's an example:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;User 1 &lt;/p&gt;


&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;~🐧&lt;span class="o"&gt;)&lt;/span&gt;: &lt;span class="nb"&gt;echo &lt;/span&gt;password | &lt;span class="nb"&gt;sha256sum
&lt;/span&gt;6b3a55e0261b0304143f805a24924d0c1c44524821305f31d9277843b8a10f4e&amp;gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;User 2&lt;/p&gt;


&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;~🐧&lt;span class="o"&gt;)&lt;/span&gt;: &lt;span class="nb"&gt;echo &lt;/span&gt;password | &lt;span class="nb"&gt;sha256sum
&lt;/span&gt;6b3a55e0261b0304143f805a24924d0c1c44524821305f31d9277843b8a10f4e&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;p&gt;The &lt;strong&gt;hashed&lt;/strong&gt; passwords are identical; and that makes sense, they're the same password passed through the same algorithm. The problem arises when two separate users have the same &lt;strong&gt;hashed&lt;/strong&gt; password and a bad actor gets a hold of these password and they can draw similarities.&lt;/p&gt;

&lt;h4&gt;
  
  
  Hypothetical scenario of compromised data:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;User 1&lt;/strong&gt; uses the same password for every-site (not an uncommon thing). One of the sites gets their user-data leaked (also not an uncommon thing) which happens to have &lt;strong&gt;User 1&lt;/strong&gt;'s raw password stored. Then another site gets leaked that has &lt;strong&gt;User 1&lt;/strong&gt; and &lt;strong&gt;User 2&lt;/strong&gt;'s passwords that are hashed (but not salted). It's as easy as running a &lt;code&gt;grep&lt;/code&gt; search and comparing hashes.&lt;/p&gt;




&lt;h3&gt;
  
  
  Adding a random SALT:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;User 1&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(~🐧): echo 01anv3password | sha256sum
afe1f6368ce0f7400ee266d52908e190e64779f2f91f4824ea8f1e595fe76ae1
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;User 2&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(~🐧): echo aKdu4ppassword | sha256sum
a0c787128946d0319fbbbd41312a37c274d7dee345bfad74fca4c670c1bcfea5 
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;p&gt;From above, adding a random six character SALT changes the &lt;strong&gt;hash&lt;/strong&gt; completely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Salting is the process of adding data into a value before hashing it&lt;/li&gt;
&lt;li&gt;Salts should be random&lt;/li&gt;
&lt;li&gt;Hashing is converting data into a &lt;em&gt;fixed-length&lt;/em&gt; string&lt;/li&gt;
&lt;li&gt;Hashing is not the same thing as encryption&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;[🐧&lt;em&gt;N.S&lt;/em&gt;]&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Demo post</title>
      <dc:creator>Neo Sahadeo</dc:creator>
      <pubDate>Wed, 03 Jul 2024 19:51:38 +0000</pubDate>
      <link>https://dev.to/notedbyneosahadeo/demo-post-21dj</link>
      <guid>https://dev.to/notedbyneosahadeo/demo-post-21dj</guid>
      <description>&lt;p&gt;please no reading&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
