开发者

(iphone) how to send password to my server?

I have a server(not web server) which iphone device would need to connect to.

Connection/transactions are all done in bsd socket in c++ (not NS* - iphone related class).

I need clients to send password to server and was simply encrypting with symmetric algorithm.

Then, I realized that apple requires me to list all encryption algorithm I us开发者_如何学编程ed and so on. (they seem rather picky about it)

I've looked over stackoverflow and all refer to SSL which I haven't used at all.

  1. Is it absolutely required to use SSL assuming password will be used to spend game-money in my app.
  2. It seems I need to buy a certificate for SSL which isn't cheap. is there a way to set up a certificate myself at least for test? (i'm ignorant of SSL mechanism except I know it utuilizes public key encryption)
  3. How should I add ssl capability to my existing socket class? is there a tutorial that can give me a starting point? Is it a matter of setting up a socket option or wrapping existing socket with something?
  4. Does iphone sdk provide ssl library that I can integrate to c++ class? (no NS* object) Because I share the c++ socket class(which is just a wrapper around c socket functions) between iphone client and server.

It's a long list of questions;;

Thank you very much in advance.


  1. True
  2. False - Getting an SSL certificate that works on iOS is as cheap as free. I have used StartSSL on iOS with flawless results. The cost of PKI is a myth. There are lots of reputable solutions out there and there really should not be any excuse why you wouldn't be able to implement security like this for either low cost, or none at all.
  3. Don't use raw sockets if you can help it, why not use HTTP? If you go with standard protocols, you get a lot of lift and not coincidentally, SSL as well.
  4. If you go HTTP, then you can use NSURLConnection, or bare-minimum, CFNetwork, which is a C API that bakes in all the HTTP communication you'll need to make. Because C++ is a superset of C you can add that in without any problems. That said, I am not sure what your aversion to Objective-C is. It's the first-class citizen on iPhone, why not leverage it?
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜