title: Ruby string#crypt in c# and php
body: <p>I have a ruby client program that encrypts a password with string#crypt like so</p>
  
  <pre><code>  encrypted = password.crypt(SALT)
    # removing first two characters which actually are the salt for safety
    return encrypted[2, encrypted.size - 2]
  </code></pre>
  
  <p>it then sends it to a server for comparison with it's stored pre-encrypted string.
  how ever I need to be able to send the same encrypted password form a c# app and a php web page and still be able to log in with the same password from any of the other clients.</p>
  
  <p>what would be the equivalent code in C# and php for the encryption?</p>