This program dynamically encrypts the password to a page (differently each time) before saving it, making it a lot harder for foul-minded users to break in. In addition, the program does not simply take the surfer to the file he/she enters as the password. Instead, it navigates to a page only if the surfer correctly enters the password. Invalid passwords will result in an "invalid password" alert.
You can use a basic cookie script to keep visitors (that don't have the cookie on their system) from viewing certain parts of your site (kind of.... There are always ways around it). The cookie is placed when the password provided is correct. Then, when they are forwarded to the password protected page, the cookie allows them to stay. Those without the cookie are sent back.