0
votes

I want to implement an application in android (as client) who sends an encrypted string to php server and php server will decrypt that string.

There is no any problem to encryption logic, but I have no idea about how can share my key(if I use AES/ RSA).

Please post some examples or links where I can understand how can I share my keys to server and client.

1

1 Answers

2
votes

To do this securely, you have to design a cryptographic protocol. If you don't know how to share keys, chances are you are not qualified to do so (few people are). So your best bet is to just use SSL. It will handle both authentication (through certificates), and encryption (by generating a session key each time you connect and using it to encrypt data). Both RSA and AES (or some other symmetric cipher) will be used in the process.

If you are using PHP, all you need to do on the server is to set up Apache for SSL.