<?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>Forem: dewbiez</title>
    <description>The latest articles on Forem by dewbiez (@devmazee2057282).</description>
    <link>https://forem.com/devmazee2057282</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%2Fuser%2Fprofile_image%2F77105%2F5acf7be4-7730-452a-954c-bd04702d75d9.jpg</url>
      <title>Forem: dewbiez</title>
      <link>https://forem.com/devmazee2057282</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/devmazee2057282"/>
    <language>en</language>
    <item>
      <title>PHP Frameworks Discussion (beware lots of opinions)</title>
      <dc:creator>dewbiez</dc:creator>
      <pubDate>Thu, 04 Oct 2018 16:16:23 +0000</pubDate>
      <link>https://forem.com/devmazee2057282/php-frameworks-discussion-beware-lots-of-opinions-fo</link>
      <guid>https://forem.com/devmazee2057282/php-frameworks-discussion-beware-lots-of-opinions-fo</guid>
      <description>&lt;p&gt;I prefer either Phalcon, or modular with independent composer packages that are not coupled to others. I did Laravel development for a while, but I couldn't seem to get the performance I wanted out of it.&lt;/p&gt;

&lt;p&gt;What about you?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>php</category>
    </item>
    <item>
      <title>PHP Package: Caller</title>
      <dc:creator>dewbiez</dc:creator>
      <pubDate>Sat, 29 Sep 2018 22:14:42 +0000</pubDate>
      <link>https://forem.com/devmazee2057282/php-package-caller-1043</link>
      <guid>https://forem.com/devmazee2057282/php-package-caller-1043</guid>
      <description>

&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qF2jUiUG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-6a5bca60a4ebf959a6df7f08217acd07ac2bc285164fae041eacb8a148b1bab9.svg"&gt;&lt;a href="https://github.com/fobber"&gt;fobber&lt;/a&gt; / &lt;a href="https://github.com/fobber/caller"&gt;caller&lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;A library for calling functions, closures, classes and methods.&lt;/h3&gt;
  &lt;/div&gt;
&lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="instapaper_body md"&gt;
&lt;h1&gt;
About&lt;/h1&gt;
&lt;p&gt;This is a library that can be used to call functions, closures(AKA: anonymous functions), classes and methods. It can be used for calling dynamic values, say a handler in an HTTP router. Or containers.&lt;/p&gt;
&lt;h2&gt;
Installation&lt;/h2&gt;
&lt;p&gt;You can install this via composer, or manually download the files.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;composer require fobber/caller
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;
Caller Documentation&lt;/h3&gt;
&lt;div class="highlight highlight-text-html-php"&gt;&lt;pre&gt;&lt;span class="pl-s1"&gt;&lt;span class="pl-c1"&gt;\Fobber\Caller\&lt;/span&gt;&lt;span class="pl-c1"&gt;Caller&lt;/span&gt;&lt;span class="pl-k"&gt;::&lt;/span&gt;callClosure(&lt;/span&gt;
&lt;span class="pl-s1"&gt;    \&lt;span class="pl-c1"&gt;Closure&lt;/span&gt; &lt;span class="pl-smi"&gt;$closure&lt;/span&gt;,&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-k"&gt;array&lt;/span&gt;    &lt;span class="pl-smi"&gt;$parameters&lt;/span&gt; &lt;span class="pl-k"&gt;=&lt;/span&gt; []&lt;/span&gt;
&lt;span class="pl-s1"&gt;);&lt;/span&gt;
&lt;span class="pl-s1"&gt;&lt;span class="pl-c1"&gt;\Fobber\Caller\&lt;/span&gt;&lt;span class="pl-c1"&gt;Caller&lt;/span&gt;&lt;span class="pl-k"&gt;::&lt;/span&gt;callFunction(&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-k"&gt;string&lt;/span&gt; &lt;span class="pl-smi"&gt;$function&lt;/span&gt;,&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-k"&gt;array&lt;/span&gt;  &lt;span class="pl-smi"&gt;$parameters&lt;/span&gt; &lt;span class="pl-k"&gt;=&lt;/span&gt; []&lt;/span&gt;
&lt;span class="pl-s1"&gt;);&lt;/span&gt;
&lt;span class="pl-s1"&gt;&lt;span class="pl-c1"&gt;\Fobber\Caller\&lt;/span&gt;&lt;span class="pl-c1"&gt;Caller&lt;/span&gt;&lt;span class="pl-k"&gt;::&lt;/span&gt;callClass(&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-k"&gt;string&lt;/span&gt; &lt;span class="pl-smi"&gt;$class&lt;/span&gt;,&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-k"&gt;array&lt;/span&gt;  &lt;span class="pl-smi"&gt;$parameters&lt;/span&gt; &lt;span class="pl-k"&gt;=&lt;/span&gt; []&lt;/span&gt;
&lt;span class="pl-s1"&gt;);&lt;/span&gt;
&lt;span class="pl-s1"&gt;&lt;span class="pl-c1"&gt;\Fobber\Caller\&lt;/span&gt;&lt;span class="pl-c1"&gt;Caller&lt;/span&gt;&lt;span class="pl-k"&gt;::&lt;/span&gt;callMethod(&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-k"&gt;object&lt;/span&gt; &lt;span class="pl-smi"&gt;$object&lt;/span&gt;,&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-k"&gt;string&lt;/span&gt; &lt;span class="pl-smi"&gt;$method&lt;/span&gt;,&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-k"&gt;array&lt;/span&gt;  &lt;span class="pl-smi"&gt;$parameters&lt;/span&gt;  &lt;span class="pl-k"&gt;=&lt;/span&gt; [],&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-k"&gt;bool&lt;/span&gt;   &lt;span class="pl-smi"&gt;$static_only&lt;/span&gt; &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-c1"&gt;false&lt;/span&gt;&lt;/span&gt;
&lt;span class="pl-s1"&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;
Caller Basic Usage&lt;/h3&gt;
&lt;div class="highlight highlight-text-html-php"&gt;&lt;pre&gt;&lt;span class="pl-s1"&gt;&lt;span class="pl-k"&gt;require_once&lt;/span&gt; &lt;span class="pl-c1"&gt;__DIR__&lt;/span&gt;&lt;span class="pl-k"&gt;.&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;/path/to/autoload.php&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;;&lt;/span&gt;

&lt;span class="pl-s1"&gt;&lt;span class="pl-k"&gt;use&lt;/span&gt; &lt;span class="pl-c1"&gt;\Fobber\Caller\{&lt;/span&gt;&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-c1"&gt;Validator&lt;/span&gt;,&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-c1"&gt;Caller&lt;/span&gt;&lt;/span&gt;
&lt;span class="pl-s1"&gt;};&lt;/span&gt;

&lt;span class="pl-s1"&gt;&lt;span class="pl-k"&gt;use&lt;/span&gt; &lt;span class="pl-c1"&gt;\Fobber\Exceptions\{&lt;/span&gt;&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-c1"&gt;InvalidFunctionException&lt;/span&gt;,&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-c1"&gt;InvalidClassException&lt;/span&gt;,&lt;/span&gt;
&lt;span class="pl-s1"&gt;    &lt;span class="pl-c1"&gt;InvalidMethodException&lt;/span&gt;&lt;/span&gt;
&lt;span class="pl-s1"&gt;};&lt;/span&gt;

&lt;span class="pl-s1"&gt;&lt;span class="pl-smi"&gt;$validator&lt;/span&gt; &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-k"&gt;new&lt;/span&gt; &lt;span class="pl-c1"&gt;Validator&lt;/span&gt;;&lt;/span&gt;
&lt;span class="pl-s1"&gt;&lt;span class="pl-smi"&gt;$caller&lt;/span&gt;    &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-k"&gt;new&lt;/span&gt; &lt;span class="pl-c1"&gt;Caller&lt;/span&gt;(&lt;span class="pl-smi"&gt;$validator&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;
Calling Closures&lt;/h4&gt;
&lt;div class="highlight highlight-text-html-php"&gt;
&lt;pre&gt;&lt;span class="pl-s1"&gt;&lt;span class="pl-smi"&gt;$value&lt;/span&gt; &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-smi"&gt;$caller&lt;/span&gt;&lt;span class="pl-k"&gt;-&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
&lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/fobber/caller"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Hey! I published my first library to composer. Any PHP developers have time to read some code, you can check out my package on GitHub/Packagist.&lt;/p&gt;

&lt;p&gt;If you read the code, it'd be nice if you'd let me know what you think.&lt;/p&gt;

&lt;p&gt;You can install it via Composer, like so:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require fobber/caller
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It's a library for calling things like functions, closures, classes and methods. You might be wondering why I would make something like this, but I made it so you can utilize it to make calls to dynamic values/handlers. Let's say you're building a Router library. And you want to able to separate your code into different files, like Controllers.&lt;/p&gt;

&lt;p&gt;So you could so something similar to:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$object&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$caller&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;callClass&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;IndexController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$method&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'__invoke'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$parameters&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nv"&gt;$caller&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;callMethod&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$object&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$parameters&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Or later once I got it implemented:&lt;/strong&gt;&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$caller&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'IndexController'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And with a neat little feature, you can have prefix and suffix parameters. If say all your controllers and their methods need a &lt;code&gt;$request&lt;/code&gt; and &lt;code&gt;$response&lt;/code&gt;, you can set it. And all you have to do is this:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$caller&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'IndexController'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




</description>
      <category>php</category>
      <category>showdev</category>
    </item>
    <item>
      <title>PHP Security: Passwords</title>
      <dc:creator>dewbiez</dc:creator>
      <pubDate>Sat, 22 Sep 2018 02:53:35 +0000</pubDate>
      <link>https://forem.com/devmazee2057282/php-security-passwords-1moi</link>
      <guid>https://forem.com/devmazee2057282/php-security-passwords-1moi</guid>
      <description>&lt;h1&gt;
  
  
  My Password Rules
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Minimum length of 16 characters.&lt;/li&gt;
&lt;li&gt;Maximum length of 256, 512, 1,024 or 2,048 characters.&lt;/li&gt;
&lt;li&gt;Make sure the password isn't pwned.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ALLOW PASTING OF PASSWORDS!&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Microsoft has a &lt;strong&gt;maximum&lt;/strong&gt; password length of &lt;em&gt;16 characters.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Does that sound good to you? Well, it certainly shouldn't. It's not often applications have such low maximum lengths for passwords(correct me if I'm wrong). But it's really bad to limit your password lengths like Microsoft did.&lt;/p&gt;

&lt;p&gt;It's debatable whether you should enforce password rules such as special characters, uppercase letter, lowercase letter, etc. I don't believe that's the better thing to do. &lt;strong&gt;I strongly disagree&lt;/strong&gt; with password rules like that.&lt;/p&gt;

&lt;p&gt;All the application should do is make sure my secret is long enough, and hash it slowly so my secret won't be found out within anyone's lifetime.&lt;/p&gt;

&lt;p&gt;A lot of sites have a minimum password length of 6 or 8 characters. That's not good. It really isn't. Even if they're using Argon2 with a high cost. 12 characters is okay ... but I like to set the minimum to around 16 characters long.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why allow such a big maximum number of characters? It's ridiculous!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You're right. It &lt;em&gt;probably&lt;/em&gt; is. But I like to make sure password managers are able to input super long passwords.&lt;/p&gt;

&lt;h1&gt;
  
  
  Storing Passwords
&lt;/h1&gt;

&lt;p&gt;I'll show you how easy it is to securely hash passwords in PHP &amp;gt;= 5.6. It's automatically salted.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$hashed_password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;password_hash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'string'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;PASSWORD_DEFAULT&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The default password hashing algorithm as of PHP 7.2 and lower is bcrypt. But note, while bcrypt is good, it truncates passwords at 72 characters, and is vulnerable to null bytes.&lt;/p&gt;

&lt;p&gt;My preferred way of storing passwords will &lt;em&gt;probably&lt;/em&gt; differ from yours.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Technique
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;HMAC the password.&lt;/li&gt;
&lt;li&gt;Hash the HMAC.&lt;/li&gt;
&lt;li&gt;Encrypt the hash.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why the heck are you HMACing the password?!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well, that's because when say someone is registering to your site. What if they put in a 4 megabyte password, and send &lt;em&gt;multiple&lt;/em&gt; requests? This could effectively DDoS you. However, you can prevent that, by pre-hashing with a fast algorithm such as SHA256. Or you can validate the password and make sure it doesn't go past a maximum number of characters. And if it passes the validation, then you can hash the password, etc.&lt;/p&gt;

&lt;p&gt;But that's not the only problem it can solve. What if you're storing PINs? Only 4 digit numbers, can be brute-forced within a reasonable amount of time. Think about it, you're only hashing 4 characters. You can turn 4 characters, into a really long string with an HMAC. And there you go, it's better than just storing 4 characters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does it DDoS you?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It requires a lot of computing power for say Argon2. Now remember, password hashing algorithms are &lt;em&gt;meant&lt;/em&gt; to be slow. So if it takes 1 second to hash a 8 character password, it might take 10 seconds to hash a 1 megabyte password. Which is &lt;em&gt;why&lt;/em&gt; we shorten or lengthen a password to a set length so we don't have that issue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But mixing up different algorithms is dangerous!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It can be, but I &lt;em&gt;highly&lt;/em&gt; doubt hashing a SHA3-512 hexadecimal output will do anything bad in a Argon2 hash function, because it's literally just numbers and letters. Isn't that what a password usually is?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Okay, but why are you encrypting the hash?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's not a performance issue if you're using fast encryption algorithms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Still! Why? It adds no benefits, and makes your application harder to maintain.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's actually a good argument. However, say your database server is separate from your application server. &lt;strong&gt;If&lt;/strong&gt; an attacker &lt;em&gt;only&lt;/em&gt; gets access, to the database, they first have to find the encryption key to decrypt the hash, or eventually break it, only to have to stop dead in their tracks with a really slow hashed password. But in the real world, I doubt someone would try to brute-force AES encryption, they'd probably start looking for the key. But doing this &lt;em&gt;can&lt;/em&gt; buy you time, possibly enough time to rotate your keys and tell users their data has been compromised.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Code
&lt;/h3&gt;

&lt;p&gt;I can also show you a quick basic implementation in PHP.&lt;/p&gt;

&lt;p&gt;First, we of course need a password.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'my super secret password'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that's done, we can setup the HMAC's algorithm and key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$hmac_algorithm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'sha3-512'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$hmac_key&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;random_bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 1: Make the HMAC.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$hmac&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;hash_hmac&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$hmac_algorithm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$hmac_key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ta da! Now that's done, let's move on to setting the password hashing up.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$password_hash_cost&lt;/span&gt;      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$password_hash_algorithm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;PASSWORD_ARGON2I&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$password_hash_options&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'memory_cost'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$password_hash_cost&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;PASSWORD_ARGON2_DEFAULT_MEMORY_COST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'time_cost'&lt;/span&gt;   &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$password_hash_cost&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;PASSWORD_ARGON2_DEFAULT_TIME_COST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'threads'&lt;/span&gt;     &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$password_hash_cost&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;PASSWORD_ARGON2_DEFAULT_THREADS&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2: Make the hash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;password_hash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nv"&gt;$hmac&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;$password_hash_algorithm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;$password_hash_options&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yep! That's all done. We need to setup that next step though.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$encryption_key&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;random_bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;SODIUM_CRYPTO_SECRETBOX_KEYBYTES&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$encryption_nonce&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;random_bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;SODIUM_CRYPTO_SECRETBOX_NONCEBYTES&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3: Make the ciphertext.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ciphertext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sodium_crypto_secretbox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nv"&gt;$hash&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;$encryption_nonce&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nv"&gt;$encryption_key&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I ran the above code, and these were the following outputs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HMAC output: 876dd083d78abd57c267a4cb3b64788c468f7ff9a88ab91800e5ae3cc3e25f646510fc2e2a9ccd9395ba01b814dbe76efa2acb985a7733330f4abc6b5157474c

Hash output: $argon2i$v=19$m=4096,t=8,p=8$ZEJXdlN2QU8vb3RIU3RxeA$0hU3ZokcZpPJwfmdmzwXD5KFfdmh/MyZRAFx4tLIJkc

Ciphertext output: 319dfbac430ad505b7daccfb8c827f36389b1dc747d3b3fc6cd1334e060b156800dec5268c79fe46367ad1be3ddac70540ddc19a6fb70348018a5ed27bcd2fb822a83e289833ec6d3294881eed6e45b94fa8c5a6f502ddb0851956587d6a2817bc45f82251b7e633de9cc3c2779e9b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note, I converted the ciphertext to hexadecimal. And by default the HMAC output is converted to hexadecimal. I was using PHP 7.2.9, and I was using libsodium for encryption.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I am by no means an expert in cryptography, or it's implementation. And this was my opinion on passwords, yours will probably differ.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That'll be it for today, I hope you enjoyed the article, and that perhaps you opened your mind a little more about passwords.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;EDIT, PLEASE READ:&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Don't use my technique.&lt;/strong&gt; Read the comments. Just use password hashing algorithms such as Argon2 or Bcrypt to store your passwords.&lt;/p&gt;

&lt;p&gt;Like I said before. Encrypting the password hashes will only be effective if you keep the &lt;strong&gt;application and database on separate servers/hardware,&lt;/strong&gt; assuming the attackers only gain access to your database.&lt;/p&gt;

</description>
      <category>php</category>
      <category>security</category>
      <category>cryptography</category>
    </item>
    <item>
      <title>PHP Security: Introduction</title>
      <dc:creator>dewbiez</dc:creator>
      <pubDate>Thu, 20 Sep 2018 10:58:16 +0000</pubDate>
      <link>https://forem.com/devmazee2057282/php-security-introduction-4ag7</link>
      <guid>https://forem.com/devmazee2057282/php-security-introduction-4ag7</guid>
      <description>&lt;p&gt;Often, these days vulnerabilities are &lt;em&gt;still&lt;/em&gt; being found in web applications. PHP has a pretty bad reputation regarding security, including one of the most popular frameworks WordPress. It's not to say making applications without vulnerabilities is easy- or that it's possible. But we really should try harder.&lt;/p&gt;

&lt;p&gt;Us as PHP developers, need to make sure our data is safe from attackers. We need to &lt;strong&gt;stop&lt;/strong&gt; this nonsense. And it's a big issue, big companies and businesses are continuing to be exploited and breached because of their security. I believe one of the big companies recently had a database breach, and they looked like they were stored with base64 and either sha1 or md5 hashing. I don't recall which company this was.&lt;/p&gt;

&lt;p&gt;But remember, hashing, encryption, is only a small part of keeping your applications secure. You also have &lt;em&gt;SQL injection, cross-site scripting, session hijacking, remote file inclusion, cross-site request forgeries.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And that's to name a few off the top of my head. There's &lt;strong&gt;a lot&lt;/strong&gt; to cover in web application security.&lt;/p&gt;

&lt;p&gt;You can start off with &lt;a href="https://phptherightway.com" rel="noopener noreferrer"&gt;PHP The Right Way&lt;/a&gt;, and &lt;a href="https://phpdelusions.net" rel="noopener noreferrer"&gt;PHP Delusions&lt;/a&gt;. They're great, especially for beginners(at least I think so).&lt;/p&gt;

&lt;h1&gt;
  
  
  Let's get real.
&lt;/h1&gt;

&lt;p&gt;That stuff up there? Those links? Their information? It's absolutely great! It really is. It's basic, more of a baseline. &lt;em&gt;A starting point, if you will.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://paragonie.com" rel="noopener noreferrer"&gt;Paragonie&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;They make open-source software, &lt;em&gt;for PHP security!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Their blog is &lt;strong&gt;amazing!&lt;/strong&gt; However, they're not well known. They really should be though. So why don't &lt;em&gt;you&lt;/em&gt; help with that? Once you're convinced they're amazing, start recommending their posts, and them in general.&lt;/p&gt;

&lt;p&gt;They cover a lot of things. If you wanna get serious about web application security, I highly recommend you bookmark that page, follow them on Twitter, and keep an eye out for any future blog posts.&lt;/p&gt;

&lt;p&gt;Don't forget to go through their archives. There is a lot of stuff there.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Psst! They're on here too.&lt;/em&gt;&lt;/p&gt;


&lt;div class="ltag__user ltag__user__id__725"&gt;
    &lt;a href="/paragoniescott" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F725%2F11591518.png" alt="paragoniescott image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/paragoniescott"&gt;Scott Arciszewski&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/paragoniescott"&gt;I do crypto/appsec/development for Paragon Initiative Enterprises.&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;





&lt;p&gt;Come on, let's make our web more secure! If you wanna post any links in the comments regarding security, please do so!&lt;/p&gt;

&lt;h3&gt;
  
  
  Extra Links
&lt;/h3&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/dotnetcoreblog" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F74588%2F39c634f0-0bb1-4f03-995f-13dc9fb33a3f.jpg" alt="dotnetcoreblog"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/dotnetcoreblog/three-steps-for-increasing-the-security-of-your-web-apps-3clg" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Three Steps For Increasing The Security of Your Web Apps&lt;/h2&gt;
      &lt;h3&gt;Jamie ・ Sep 13 '18&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#http&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webappsecurity&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#owasp&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/dotnetcoreblog" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F74588%2F39c634f0-0bb1-4f03-995f-13dc9fb33a3f.jpg" alt="dotnetcoreblog"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/dotnetcoreblog/owasp---who-jck" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;OWASP - Who?&lt;/h2&gt;
      &lt;h3&gt;Jamie ・ Sep 19 '18&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#owasp&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;





&lt;h3&gt;
  
  
  Next Article
&lt;/h3&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/devmazee2057282" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F77105%2F5acf7be4-7730-452a-954c-bd04702d75d9.jpg" alt="devmazee2057282"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/devmazee2057282/php-security-passwords-1moi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;PHP Security: Passwords&lt;/h2&gt;
      &lt;h3&gt;dewbiez ・ Sep 22 '18&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#php&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#cryptography&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>php</category>
      <category>security</category>
    </item>
    <item>
      <title>Symmetric Encryption Key Storage</title>
      <dc:creator>dewbiez</dc:creator>
      <pubDate>Wed, 22 Aug 2018 06:49:17 +0000</pubDate>
      <link>https://forem.com/devmazee2057282/symmetric-encryption-key-storage-2030</link>
      <guid>https://forem.com/devmazee2057282/symmetric-encryption-key-storage-2030</guid>
      <description>&lt;p&gt;I was wondering ... if say you're using something like AES(symmetric based), while you can use it to protect data, encrypting it. How do you protect the key used to encrypt the data? Where should you store it? How should you retrieve it?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>cryptography</category>
    </item>
    <item>
      <title>Learning Resources</title>
      <dc:creator>dewbiez</dc:creator>
      <pubDate>Wed, 22 Aug 2018 00:31:57 +0000</pubDate>
      <link>https://forem.com/devmazee2057282/learning-resources-3ekl</link>
      <guid>https://forem.com/devmazee2057282/learning-resources-3ekl</guid>
      <description>&lt;h2&gt;
  
  
  &lt;a href="https://dev.to"&gt;Dev&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A community regarding software development, lots of help and articles available.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://devdocs.io"&gt;DevDocs&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Provides an easy to use way to search through many popular documentations, more being added. With &lt;em&gt;offline&lt;/em&gt; support!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://readthedocs.org"&gt;Read the Docs&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Another site for reading documentation? Hmm!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://alligator.io"&gt;Alligator&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Articles about front-end web development, and don't forget to check out &lt;a href="https://alligator.io/resources"&gt;their resources!&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://scotch.io"&gt;Scotch&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Another articles site, regarding many technologies.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://egghead.io"&gt;Egghead&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A videos site for web developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://sabe.io"&gt;Sabe&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Articles and courses on web development.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://exercism.io/"&gt;Exercism&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Exercises, courses and things like that.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://bento.io"&gt;Bento&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A website for website developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://hackr.io"&gt;Hackr&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Courses, tutorials and a forum.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://coligo.io"&gt;Coligo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Some more tutorials for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://tahazsh.com"&gt;Taha Shashtari&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A person writing about Vue.js, worth checking out.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://blog.osninja.io"&gt;The Ninja Vault&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A site with blog posts on technologies.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://resilientwebdesign.com"&gt;Resilient Web Design&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This is amazing! Please go read it.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://learn.shayhowe.com"&gt;Learn to Code HTML &amp;amp; CSS&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Looks REALLY good, I highly suggest this for HTML and CSS developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://html-css-js.com"&gt;HTML, CSS &amp;amp; JavaScript&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;I don't know what else to say about this, just look at it.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://tympanus.net/codrops"&gt;Codrops Useful Resources&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Yay! More resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://skills.learnstartup.net"&gt;LearnStartup&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;It has LOTS of stuff you can learn about. Building games(both web based and not) and websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.gethopscotch.com"&gt;Hopscotch&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Learn to code with games!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://codecombat.com"&gt;CodeCombat&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Another way of learning to code with games.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://ilovecoding.org"&gt;ILoveCoding&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A way to learn to code.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.codeavengers.com"&gt;Coding Avengers&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;I know I wanna become an Avenger. A coding Avenger!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="http://www.vikingcodeschool.com"&gt;Viking Code School&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Really cool name, but besides that come learn to code.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="http://programming-motherfucker.com"&gt;Programming Motherfucker&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Try not to take offense to this. It's actually what it's called, but ya know. Why not check it out? Become a gangster! A pogramming gangster. ;)&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://fridayfrontend.curated.co"&gt;Friday Front-End&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A news letter on front-end, sent to you every Friday. I think.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://umaar.com/dev-tips"&gt;Dev-Tips&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Get Weekly developer tips in your inbox.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://webtoolsweekly.com"&gt;Web Tools Weekly&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Another weekly inbox thing for developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.afterhoursprogramming.com"&gt;After Hours Programming&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A lot of tutorials on software developing.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="http://www.devshed.com"&gt;DevShed&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Worth checking out, a developer community.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://devdojo.com"&gt;Devdojo&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Another website focused on web development with videos.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.sitepoint.com"&gt;Sitepoint&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;More articles, and tutorials.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://tutorialzine.com"&gt;Tutorialzine&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Articles plus a community with forums. Mostly front-end.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.tutorialspoint.com"&gt;Tutorialspoint&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Tutorials, tutorials and oh yeah, more tutorials.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="http://www.vitallogic.co.uk"&gt;Vitallogic&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Articles duh! Probably not as promising as the other links on here though.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://tutsplus.com"&gt;Tuts+&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Tutorials! And plus more tutorials. Has some good ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.cleverprogrammer.com"&gt;CleverProgrammer&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Learn Python. He's really good.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://scrimba.com"&gt;Scrimba&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Something else to check out! It has video courses along with a built in editor. Definitely check it out.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.pluralsight.com/codeschool"&gt;CodeSchool&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Not free, but it's supposed to be really good.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://phpschool.io"&gt;PHP School&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Schooling you on PHP, check it out. Looks pretty cool.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://nodeschool.io"&gt;NodeSchool&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Now schooling you on Node.js, pretty cool huh?&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://vueschool.io"&gt;VueSchool&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Whoa! A school on Vue too? YEP! Free too!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.vuemastery.com"&gt;VueMastery&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;And I can't forget them! Note, a lot of the stuff you have to pay for. But it's supposed to be really good.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://w3schools.com"&gt;W3Schools&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Web tutorials, not recommended for beginners as this has some outdated content. Don't want beginners using bad practices now do we? Non-beginners should be smart enough to know what not to trust. They also have some &lt;a href="https://www.w3resource.com"&gt;resources.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://freecodecamp.org"&gt;FreeCodeCamp&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Amazing tutorials, and don't forget to check out  &lt;a href="https://medium.freecodecamp.org"&gt;their medium blog.&lt;/a&gt; I would highly recommend this for coding beginners.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.codecademy.com"&gt;Codecademy&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Another great source to get started in the world of coding. I highly recommend this for coding beginners as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="http://css-tricks.com"&gt;CSS-Tricks&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Great tips, snippets and articles. This is also not strictly CSS related.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="http://eloquentjavascript.net"&gt;Eloquent JavaScript&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A really good site(book) on JavaScript? Find out for yourself! It looks promising.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="http://jstherightway.org"&gt;JS: The Right Way&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Do JavaScript better than you did before???&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://javascript.info"&gt;Modern JavaScript Tutorials&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Here is some modern JavaScript tutorials for ya!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://phpdelusions.net"&gt;PHP Delusions&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A pretty good site, having one of the best tutorials/guides on database interaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://paragonie.com"&gt;Paragonie PHP Security&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;While yes they are mainly focused on PHP security, you can still apply their concepts to other languages you use. FYI, they're awesome. By far the best site or resources regarding security on PHP.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.phptherightway.com"&gt;PHP: The Right Way&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Seriously, if you're a PHP developer you really should read this. It's got best(better) practices. Highly recommended.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://phpbestpractices.org"&gt;PHP Best Practices&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Not as promising as PHP The Right Way, but shouldn't be too bad.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://php.net"&gt;PHP Docs&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;You better read some of the stuff on PHP on here.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://phpsecurity.readthedocs.io"&gt;PHP Security Stuff&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Yes, more on PHP security. Check it out, probably a good idea.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.php-fig.org"&gt;PHP Collaboration Standards&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;You definitely should look at this. It's standard guideline stuff.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://laracasts.com"&gt;Laracasts&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Tons of videos on web development. Some of them free, check them out.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://laravel-news.com"&gt;Laravel News&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;News on the Laravel framework and packages.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.laravel-vuejs.com"&gt;Laravel &amp;amp; VueJS&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Articles regarding Laravel and Vue.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.hacksplaining.com"&gt;Hacksplaining&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Learn stuff about hacking! It's pretty good, done it myself.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://xeushack.com"&gt;XeusHack&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Hacking tutorials. Something else worth checking out.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://elite-hackers.com"&gt;Elite Hackers&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Ahem, &lt;em&gt;sshh&lt;/em&gt; and delete your history. Heading into dangerous territory. Probably should view this site with TOR or something.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.khanacademy.org"&gt;Khan Academy&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Has some stuff related to software development, but is general purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.udemy.com"&gt;Udemy&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Has lots of courses on software development, and many other things.&lt;/p&gt;

</description>
      <category>resources</category>
    </item>
    <item>
      <title>Handling Passwords</title>
      <dc:creator>dewbiez</dc:creator>
      <pubDate>Mon, 20 Aug 2018 23:28:28 +0000</pubDate>
      <link>https://forem.com/devmazee2057282/handling-passwords-gfk</link>
      <guid>https://forem.com/devmazee2057282/handling-passwords-gfk</guid>
      <description>&lt;h2&gt;
  
  
  Rules
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Minimum length of either 8 or 16 characters.&lt;/li&gt;
&lt;li&gt;A maximum length of 2,048 characters.&lt;/li&gt;
&lt;li&gt;Check if password is in breaches? (optional)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's probably a good idea to make sure they're not putting in a common or breached password. I don't have any other rules, it's pretty simple. I think having the one or more numbers, symbols, capital letters, is a bit overrated. I don't really need it, do I? Got any examples/scenarios on why an application would &lt;em&gt;need&lt;/em&gt; or &lt;em&gt;should have&lt;/em&gt; something like that? Please, share.&lt;/p&gt;

&lt;p&gt;And I encourage people who are writing password &lt;a href="https://imgs.xkcd.com/comics/password_strength.png" rel="noopener noreferrer"&gt;this.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Storage
&lt;/h2&gt;

&lt;p&gt;And as for storing passwords, I'm not just gonna leave it as plain-text, unless of course my intent is to steal credentials. So I'd use a strong hashing algorithm like Bcrypt or some variation of Argon2. Hashing the passwords is good enough, or so some of us believe. While I don't doubt that hashing the password is good, I believe that it could be taken further to protecting the passwords.&lt;/p&gt;

&lt;p&gt;Yes, &lt;em&gt;encrypt&lt;/em&gt; the hash, with something strong. Preferably AES-256 or AES-128. And perhaps a more complex approach signing keys with RSA and encrypting with AES based on that. Not gonna get too far into it(I don't wanna start talking about stuff I don't understand).&lt;/p&gt;

&lt;p&gt;Doing it this way gives hackers/crackers whatever you wish to call them, another step. To decrypt the hash, then finally deal with the hash.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Make sure the password is within (8 or 16)-2,048 characters threshold, optionally check if it's common or breached. Hash the password, then encrypt the hashed password, and finally store it somewhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recommendations
&lt;/h2&gt;

&lt;p&gt;Check these out, while you're reading about passwords.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/paragonie" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F9%2Fparagonie.png" alt="Paragon Initiative Enterprises"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F725%2F11591518.png" alt=""&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/paragonie/you-wouldnt-base64-a-password-cryptography-terms-and-concepts-for-developers" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;You Wouldn't Base64 a Password! Cryptography Terms and Concepts for Developers&lt;/h2&gt;
      &lt;h3&gt;Scott Arciszewski for Paragon Initiative Enterprises ・ Dec 13 '16&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/domysee" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F38080%2Feefdbcc1-0480-4791-a44d-2d927e3fb923.JPG" alt="domysee"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/domysee/do-password-rules-impact-security-137n" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Do password rules impact security?&lt;/h2&gt;
      &lt;h3&gt;Dominik Weber ・ Jul 8 '18&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#passwords&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#rules&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/oktadev" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F129%2F9284e7ae-5b8a-49ab-89de-0e5ebe85847b.jpg" alt="Okta"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F54664%2F110f8a94-228e-4c98-882f-5cab148205ef.png" alt=""&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/oktadev/how-to-prevent-your-users-from-using-breached-passwords-5cne" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;How to Prevent Your Users from Using Breached Passwords&lt;/h2&gt;
      &lt;h3&gt;Randall Degges for Okta ・ Jun 11 '18&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#programming&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>security</category>
      <category>password</category>
    </item>
  </channel>
</rss>
