While that type of program may exist or can be written, we do not have an archive of scripts that has one of that type available. You can password protect directories via the cpanel by following the article below. This may give you a start.
Password Protecting Directories
|Email:||support@WebHostingHub.com||Ticket:||Submit a Support Ticket|
|Chat:||Click To Chat Now|