title: iOS and .NET password encryption
body: <p>I have been working on building an iOS app to be used internally inside the company I work for. The way the user logs into the app is through the use of Active Directory (AD). The code I have for checking credentials via AD is as follows:</p>
  
  <pre><code>private bool ADAuthentication(string username, string password)
      {
          using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, "Domain Name"))
          {
              return pc.ValidateCredentials(username, password);
          }
      }
  </code></pre>
  
  <p>The problem I have is that this method requires a clear text password and I am not about to send that kind of password across a cellphone network or unknown wifi connection.</p>
  
  <p>What I am looking for is an encryption/decryption algorithm that I can encrypt the password on an iOS device, send it to our server, decrypt it, and pass it to the above method to verify AD credentials.</p>
  
  <p>So far I have investigated MD5 (which we already use in another application) and several open source BlowFish algorithms(Here is the <a href="http://www.schneier.com/blowfish-download.html" rel="nofollow noreferrer">link</a> and a <a href="https://stackoverflow.com/questions/13507384/how-to-implement-blowfish-algorithm-in-ios?answertab=active#tab-top">link</a> for how to do BlowFish in iOS). I have also done research via google looking for a solution and have not found much relating to what I need (but I could have missed something)</p>
  
  <p>Any code, links, or advice in either Objective-c or C# would be greatly appreciated since I have been at this for 2 days with little-to-no progress being made. I am open to almost anything at this point.</p>