Postgresql is a pretty cool database and it even has functions for encryption. So if you write a user-database, you don't need to use crypto-functions from your programming language to encrypt your password. You can directly use postgresql-functions!

Before we can do this, we have to install the required postgresql-extensions: