Custom validation rule to check password

I wrote a custom validation rule to check if the password is the same
as the one in the database.
Todo: error message