def check_password(self, password=None): """ Check password """ return hmac.compare_digest(self.phash, crypt.crypt(password, self.phash))