Android and Apache in a secure way -
i have developed android app. app sends data webserver(apache + mysql) using httpclient , httppost classes.
but way malicious atttacker able send custom post request webserver , corrupt database.
1 - possible encrypt data before app sends , decrypt in webserver shared key algorithm? or saying nonsense?
2 - if previous solution not one, need in summarised way implement ssl solution?
i have read many articles ssl , android still bit confused. guess have make code changes on both app , apache. can tell me tutorial deal this?
you don't need encrypt data (that's needed if want prevent data being read attacker).
what need is:
- authentication: requests trusted users (ie. app) accepted
- validation: "correct" requests processed
authentication can easy setting http basic access authentication on apache server. you'll set user , password, , have app use these credentials access server. unauthenticated request rejected 403.
unfortunately basic authentication insecure since looking @ traffic between app , server can grab credentials, forge own requests.
oauth better option, although more involved. here's nice tutorial covers client side: http://nilvec.com/implementing-client-side-oauth-on-android.html
validation means you'll need sanitize data before using it. server app should assume data potentially wrong or dangerous, , filter input before processing it.
Comments
Post a Comment