Looking at the online high score leaderboard example on the wiki on I was wondering if using GET or POST via WWW to send, for example a username and password would be ok?
I understand its a no-no on web browsers as using this method as it includes the data that can be seen in the browsers address bar, but would it matter on iPhone?
Cheers.
In a browser, or app, you should never send the actual password. I’ve created a login system on an iPhone app (over the WWW class). Just obfuscate the password (md5/sha1 hash) before sending it.
POST (WWWForm) offers a bit more security simply because it isn’t seen. Even on an iPhone I would do all I could to be secure.
Thanks. Hashing passwords would be the way to go but how do I get the password from the user to compare the hash against?
You don’t save the actual password in your database but the hashed password. When you authenticate a user you compare the hashed password from the database against the hashed password you send from the app.
If your database ever gets hacked, the hackers don’t have actual passwords.
Doh of course. Thanks for your help!
If you want to take it one step further, you may want to “salt” the hash that you produce by concatenating something permanent and unique per user along with the password (like, for example, the user ID, or username if it never changes). It’s a little extra work, but it provides good defense and is pretty much the minimum level of effort if you are collecting passwords. Attackers can use something called a “rainbow table” to quickly test against known hashes of common passwords or dictionary words. This provides additional security if the hashed password is sniffed, or if your entire password database is compromised.