Are you testing logging in with Password Encryption using an existing registration that was created before modifying the registration page to store the password encrypted? Or have you created a New User that you are testing?
For the logging to succeed, the password must be stored in the database in the SHA1 encrypted format.
I can see from the code you supplied that the login page has been modified for Password Encryption so here are the other things to check:
1) make sure the password column in the database is set to hold 40 characters. The SHA1 encrypted password will be 40 characters long.
2) have you modified the registration page as outlined in the tutorial? On the registration page, the Dreamweaver Insert Record behavior needs to be replaced with the DataAssist insert record behavior so that the password will be stored in the DB in SHA1 format.
3) once the registration page has been modified for SHA1 encryption, you need to register a new user. Any user created before modifying the registration page will no longer function.