Q:

What is the best method to encrypt password in Swift?

I'm building an application that takes in login credentials (username and password). I want to encrypt before sending the data to the server. I would really appreciate if someone can provide some insight on the most common method or best practice for password encryption in Swift.

A:

If you really need to encrypt the credentials in Swift, you could use https://github.com/krzyzanowskim/CryptoSwift
But it would be best to just POST them to the server via https - that way, they will be encrypted/decrypted for you. 

