title: What is the safest way to store a password using Code Igniter?
body: <p>I am using Code Igniter for my current project.</p>
  
  <p>As of now, I am using <strong>MD5</strong> for password hashing, but I have read at a lot of places, that it is not a good practice to do so.</p>
  
  <p>What should I go with?</p>
  
  <ol>
  <li>Using a <strong>salt</strong></li>
  <li>Or should I use <strong>bcrypt</strong></li>
  </ol>
  
  <p>Also, if <strong>bcrypt</strong> is recommended, then how to use it with Code Igniter?</p>
  
  <h2>EDIT</h2>
  
  <p>I have put these files in <code>application/libraries</code></p>
  
  <ol>
  <li>PasswordHash.php</li>
  <li>c/Makefile</li>
  <li>c/crypt_private.c</li>
  </ol>
  
  <p>In my controller, I am using this code -</p>
  
  <pre><code>$params = array(
         'phpass_hash_strength' =&gt; 8,
             'phpass_hash_portable' =&gt; FALSE
         );
  $this-&gt;load-&gt;library('PasswordHash', $params);
  $password = $this-&gt;passwordhash-&gt;HashPassword($pwd);
  </code></pre>
  
  <p>I am getting these errors -</p>
  
  <pre><code>A PHP Error was encountered
  
  Severity: Notice
  
  Message: Uninitialized string offset: 3
  
  Filename: libraries/PasswordHash.php
  
  Line Number: 116
  </code></pre>
  
  <hr>
  
  <pre><code>A PHP Error was encountered
  
  Severity: Warning
  
  Message: strpos() [function.strpos]: Empty delimiter
  
  Filename: libraries/PasswordHash.php
  
  Line Number: 116
  </code></pre>
  
  <hr>
  
  <h2>Update</h2>
  
  <p>Removed <code>PasswordHash.php</code>, using <strong>SimpleLoginSecure</strong> now.</p>