<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>IT notes - crypt</title>
    <subtitle>DBRE, AWS platform engineering, PostgreSQL, Linux, FreeBSD, and Rust reference notes.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://nbari.com/tags/crypt/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://nbari.com"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2017-12-23T10:41:29+01:00</updated>
    <id>https://nbari.com/tags/crypt/atom.xml</id>
    <entry xml:lang="en">
        <title>mysql SHA512 CRYPT</title>
        <published>2017-12-23T10:41:29+01:00</published>
        <updated>2017-12-23T10:41:29+01:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nbari.com/mysql-sha512-crypt/"/>
        <id>https://nbari.com/mysql-sha512-crypt/</id>
        
        <content type="html" xml:base="https://nbari.com/mysql-sha512-crypt/">&lt;p&gt;To create a password using the  &lt;code&gt;SHA512-CRYPT&lt;/code&gt; schema:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SELECT ENCRYPT(&amp;quot;password&amp;quot;, CONCAT(&amp;#39;$6$&amp;#39;,sha(RAND())));&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To create an user:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;INSERT INTO users SET password=ENCRYPT(&amp;quot;password&amp;quot;, CONCAT(&amp;#39;$6$&amp;#39;,sha(RAND())));&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To use with postfix or dovecot:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;INSERT INTO users SET password=CONCAT(&amp;#39;{SHA512-CRYPT}&amp;#39;, ENCRYPT(&amp;quot;password&amp;quot;, CONCAT(&amp;#39;$6$&amp;#39;,sha(RAND()))));&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content>
        
    </entry>
</feed>
