i'd like some opinions about the flow i'm building for any mobile application that needs to send a combination of user and password. My idea is to encrypt the password using AES-256, generating a random passphrase and IV to generate the key. The idea is that when the password is first generated, it send to the server the encrypted password, and the IV. the IV and encrypted password will be stored at server, in a redis DB and the key, and the encrypted password, will be on the mobile device only (the IV will not be stored on the device). So each time the user needs to login, sends the to the server, the encrypted password and the key, with the IV stored, the server decrypt both encrypted password sent and the one saved in the DB, using the key just sent and the IV already on server.
In case the user wants to change their password, encrypted password, key and IV is generated again and is sent the old one too (key and encrypted password) if they match, the values are updated in server and send a notification to the client to update them too.
All of this transactions will take place inside a SSL tunneling too.
Do you think this is secure? if not why? any other option to encrypt/decrypt passwords in a secure way from a mobile device to a server?
Regards.