<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hashing Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/hashing/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Wed, 21 Nov 2018 12:29:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Password hashing on Mysql / MariaDB</title>
		<link>https://www.osradar.com/password-hashing-mysql-mariadb/</link>
					<comments>https://www.osradar.com/password-hashing-mysql-mariadb/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Tue, 20 Nov 2018 02:38:50 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[hashing]]></category>
		<category><![CDATA[mariadb]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[password]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=7445</guid>

					<description><![CDATA[<p>Data security is essential to maintain system stability. Many system administrators know the importance of passwords in computer systems. Therefore, today I will tell you about the password hashing in MySQL and MariaDB. MySQL and MariaDB are two popular database managers among application developers. Above all, because they are free, open source and because they [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/password-hashing-mysql-mariadb/">Password hashing on Mysql / MariaDB</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Data security is essential to maintain system stability. Many system administrators know the importance of passwords in computer systems. Therefore, today I will tell you about the password hashing in MySQL and MariaDB.</p>
<p><a href="https://www.mysql.com/">MySQL</a> and <a href="http://mariadb.org/">MariaDB</a> are two popular database managers among application developers. Above all, because they are free, open source and because they are very but very robust and reliable. All this is added to the fact that they are well documented and have the support of the community.</p>
<figure id="attachment_7450" aria-describedby="caption-attachment-7450" style="width: 1200px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7450" src="https://www.osradar.com/wp-content/uploads/2018/11/5-14.png" alt="Mysql" width="1200" height="1200" srcset="https://www.osradar.com/wp-content/uploads/2018/11/5-14.png 1200w, https://www.osradar.com/wp-content/uploads/2018/11/5-14-150x150.png 150w, https://www.osradar.com/wp-content/uploads/2018/11/5-14-300x300.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/5-14-768x768.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/5-14-1024x1024.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/5-14-696x696.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/5-14-1068x1068.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/5-14-420x420.png 420w" sizes="(max-width: 1200px) 100vw, 1200px" /><figcaption id="caption-attachment-7450" class="wp-caption-text">Mysql</figcaption></figure>
<p>Being two database managers, with clear objectives and good security measures, we find methods and ways to encrypt passwords or any string. that we need to protect even more.</p>
<h1>What is Password Hashing?</h1>
<p>First of all, you need to know what password hashing is. Password hashing is a way of encrypting a string so that not even the administrator of the system can know its value. It is especially useful for passwords.</p>
<p>This process is very important, but it is quite simple, they are simply functions that allow you to do it.</p>
<h1>Some functions to do Password Hashing</h1>
<p>MySQL and MariaDB have several functions that help us do a proper and hassle-free hashing. However, each of them behaves differently. Let&#8217;s see.</p>
<h3>AES_ENCRYPT FUNCTION</h3>
<p>Allow encryption of data using the official <a href="https://en.wikipedia.org/wiki/Advanced_Encryption_Standard">AES</a> (Advanced Encryption Standard) algorithm. It is very secure. Encoding with a 128-bit key length is used, but you can extend it up to 256 bits by modifying the source. However, 128-bit length is enough for many cases.</p>
<p>This function requires two parameters, the first is the String and the second is key_str.</p>
<p>For example:</p>
<pre class="fixed">INSERT INTO table_name VALUES (AES_ENCRYPT('example',SHA2('password',512)));</pre>
<p>This is the output.</p>
<h3>MD5 FUNCTION</h3>
<p>This function calculates an MD5 128-bit checksum for the string.</p>
<p>The value is returned as a string of 32 hexadecimal digits, or NULL if the argument was NULL.</p>
<pre class="">SELECT MD5 ('EXAMPLE);</pre>
<figure id="attachment_7446" aria-describedby="caption-attachment-7446" style="width: 428px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7446" src="https://www.osradar.com/wp-content/uploads/2018/11/1-15.png" alt="Using MD5 function" width="428" height="200" srcset="https://www.osradar.com/wp-content/uploads/2018/11/1-15.png 428w, https://www.osradar.com/wp-content/uploads/2018/11/1-15-300x140.png 300w" sizes="(max-width: 428px) 100vw, 428px" /><figcaption id="caption-attachment-7446" class="wp-caption-text">Using MD5 function</figcaption></figure>
<p>As you can see, the function calculates a value for the phrase or string and is useful for encrypting certain data.</p>
<h3>PASSWORD FUNCTION</h3>
<p>This is the most used function in MySQL or MariaDB to encrypt Strings. It&#8217;s really simple and we could almost say that it&#8217;s used by default, although obviously, it&#8217;s not. However, the PASSWORD() function is used for hashing passwords for use in authentication by the MariaDB server.</p>
<p>The return value is 41-bytes in length, and the first character is always &#8216;*&#8217;.</p>
<pre class="">SELECT PASSWORD ('password');</pre>
<figure id="attachment_7447" aria-describedby="caption-attachment-7447" style="width: 464px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7447" src="https://www.osradar.com/wp-content/uploads/2018/11/2-15.png" alt="PASSWORD FUNCTION" width="464" height="210" srcset="https://www.osradar.com/wp-content/uploads/2018/11/2-15.png 464w, https://www.osradar.com/wp-content/uploads/2018/11/2-15-300x136.png 300w" sizes="(max-width: 464px) 100vw, 464px" /><figcaption id="caption-attachment-7447" class="wp-caption-text">PASSWORD FUNCTION</figcaption></figure>
<h3>SHA2 FUNCTION</h3>
<p>Calculates the SHA-2 family of hash functions (SHA-224, SHA-256, SHA-384, and SHA-512). This function requires two arguments, firstly, the text to be encrypted and secondly the length of the hash (224, 256, 384, 512).</p>
<p>The SHA2 function works only if MySQL has been configured with SSL support.</p>
<pre class="fixed">SELECT SHA2('Angelo',224);
SELECT SHA2('Angelo',256);
SELECT SHA2('Angelo',384);
SELECT SHA2('Angelo',512);</pre>
<figure id="attachment_7448" aria-describedby="caption-attachment-7448" style="width: 607px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7448" src="https://www.osradar.com/wp-content/uploads/2018/11/3-14.png" alt="3.- Using SHA2 function" width="607" height="168" srcset="https://www.osradar.com/wp-content/uploads/2018/11/3-14.png 607w, https://www.osradar.com/wp-content/uploads/2018/11/3-14-300x83.png 300w" sizes="(max-width: 607px) 100vw, 607px" /><figcaption id="caption-attachment-7448" class="wp-caption-text">3.- Using SHA2 function</figcaption></figure>
<figure id="attachment_7449" aria-describedby="caption-attachment-7449" style="width: 1215px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7449" src="https://www.osradar.com/wp-content/uploads/2018/11/4-15.png" alt="4.- Other example using SHA2 function" width="1215" height="153" srcset="https://www.osradar.com/wp-content/uploads/2018/11/4-15.png 1215w, https://www.osradar.com/wp-content/uploads/2018/11/4-15-300x38.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/4-15-768x97.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/4-15-1024x129.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/4-15-696x88.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/4-15-1068x134.png 1068w" sizes="(max-width: 1215px) 100vw, 1215px" /><figcaption id="caption-attachment-7449" class="wp-caption-text">4.- Other example using the SHA2 function</figcaption></figure>
<p>This is the function more secure. It is recommended for production servers.</p>
<h1>Conclusion</h1>
<p>As you can see it&#8217;s easy to protect passwords even more. All that&#8217;s left is for you to use these tools properly.</p>
<p>If you don know how to install MySQL or MariaDB, you can read <a href="https://www.osradar.com/install-mysql-8-0-on-fedora-29-28-centos-rhel-7-6-6-10/" target="_blank" rel="noopener">this</a> article.</p>
<p>Please share this article on your social networks.</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/password-hashing-mysql-mariadb/">Password hashing on Mysql / MariaDB</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/password-hashing-mysql-mariadb/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
