What are the best practices for delivering an Adobe Air app that needs a开发者_JAVA技巧 private key in order to communicate with some online API?
Adobe Air apps seem like they are delivered to the user with full source code, so storing any keys within the source would be a really bad idea. I've read some suggestions saying to download the key from your server, but that has the same problem because the url allowing the download would have to be stored in source code. Also, suggestions saying to store in the encrypted local storage don't make sense to me either, because I still have to obtain the private key somehow.
I think this is a global problem of delivering secret keys in any application, since everything can be reverse-engineered (disasamble for executables, IL readers, etc.)
No matter what you do, if the client application needs to somehow "know" a secret key, then the user can know the secret key.
Assuming that:
- You deliver a product ("client application") which relys on some 3rd party web service ("the service").
- Your company has just one secret key ("company key") for using the service.
- The company key must never be exposed (due to possible abuse)
- Every piece of information held by or transmitted by the client application is exposed
A solution might be to use some proxy:
- The proxy implements the API of the service
- The client application connects to the proxy
- The proxy connects to the service using the company key
- The proxy delegates all calls from the client to the service and vice-versa
精彩评论