Secure password handling for crypto-pouch in ionic

After testing pouchDB for my Ionic project, I tried to encrypt my data by crypto-pouch. Now I was able to do this (only a few restrictions are left at the moment) and now I’m searching for a secure way of handling my password for the data encryption.

At the moment my app uses pouchDB only to store data local. But propably I would like to sync my database in a few months.

The requirements for handling the password are the following:

  • Unlock the database/app with the password

  • Use password for data encryption

  • Lock the database/app after a given time automatically (if there was no action for the given time)

  • Possibility to change the password

If someone of you with experience in this things could help me or even give me a tip where I can find a solution, I would be very glad. For this reason I say thanks in advance.