Final Code. Two versions

Version 1. Password check done by checking if provided password
correctly decrypts the database
Version 2. Explicit password checking by hashing the derived key.