php - How to create the same secret key both for Android and server -


based on code of following link

https://github.com/serpro/android-php-encrypt-decrypt

i have made own implementation of encryption/decryption mechanism between android , server (api written in php).

the example uses same iv in real world case scenario use different 1 in each call. easy implement since iv can transferred without caring whether listened or not.

my question how create different secret key each new user during registration, both @ android device , server side (the unique secret key stored in mysql server side , sqlite or shared preferences on android side)?

if secret key created either @ android or server , transmitted other part stolen "listener" , communication no longer safe.

if secret key created algorithm, same algorithm must implemented in both android , server. android apk file decompiled , result algorithm found , secret keys predicted.

it seems vicious circle. safe way create same unique secret key each user both @ client side (android) , sever side without having take risk transmit through post request other part?

ps. aware of ssl, https looking simpler solution since trying protect data such login details (username/password) , not "highly sensitive data" (eg credit cards etc.). reading how implement ssl/https rather confuses me making things simpler me.

using symmetric key on both sides (server , client) highly risky in kind of architecture, due reason mention: if cracks app, crack key. situation worse mention you're managing highly sensitive data. (not in kind of situation), crackers try crack application, such sensitive data, triple efforts (and successful).

that's why kind of architecture's recommended approach asymmetric encryption system, because don't have store key (the public key available in public http address), , way can use encrypt messages, it's server holds private key 1 able decrypt messages. recommend using ssl/tls here.


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -