How safe are client SSL certificates in a mobile app?

前端 未结 5 1260
青春惊慌失措
青春惊慌失措 2020-12-12 15:34

I\'d like to have secure communication between my Android/iOS app and my Internet-accessible backend service, so I\'m investigating HTTPS/SSL.

If I create self-signe

5条回答
  •  -上瘾入骨i
    2020-12-12 16:37

    Are you doing client side authentication with certificates over SSL? Not that it really matters for this question. Any private keys you store in your app is accessible to an attacker. Each client should have it's own certificate and key pair, to prevent a mass compromise. Your server should also enforce protections, ensuring a compromised client can't just request anything.

    This is true for any authentication scheme. If you embed passwords, API keys, decryption keys, whatever. Anything on the device should be assumed to be accessible.

    The added security from certificates in part comes from there being nothing to brute force. If you went the username/password route for each clients, passwords can be guessed. Same with API keys (albeit they are longer and harder). With certificates, it's an entirely different class of attacks, and a considerably harder problem.

    But, most importantly, the backend service shouldn't allow the app to do anything it wouldn't normally do.

    Now, dealing with certificates, you're going to have a whole host of other problems. You probably want to sign each client certificate with your self-signed CA cert. Managing that CA cert can be problematic, depending on your use case. Are you going to generate these client certs on the fly, or manually yourself? Meaning, is this an app that a million people can download, and you need an automated system for generating them? Or is this a private/internal app that you personally will handle generating certs?

提交回复
热议问题