title: Blowfish Implementation for C#.NET - Moving from PHP to C#
body: <p>I'm moving my application from PHP to C# MVC.  I've been using the following method to encrypt passwords:</p>
  
  <pre><code>string password_hash ( string $password )
  </code></pre>
  
  <p>By Default, password_hash() uses the BLOWFISH hashing algorithm and produces hashes prefixed with <code>$2y$</code>.</p>
  
  <p>I've looked at, and given a go, quite a few <em>supposed</em> implementations of the algorithm, but none of them seem to work with my existing hashes and I'm not sure if I can trust any of them.</p>
  
  <p>I've tried:</p>
  
  <ul>
  <li><strong>Bcrypt.NET from Nuget</strong></li>
  <li><a href="https://defuse.ca/blowfish.htm" rel="nofollow">This</a></li>
  <li>I was thinking of giving <a href="http://www.bouncycastle.org/csharp/" rel="nofollow">This</a> a go until I realised that it says 'Unlisted' on the Nuget page.</li>
  </ul>
  
  <p>I need it so that I can verify existing hashes in my database and restore them using the standard C# .MVC Identity Framework method when a user logs in again.</p>
  
  <p>How can I verify passwords generated using <code>password_hash()</code> in PHP using C#?</p>