How do i set a password to a directory?

A situation where i need to create 10 directories and set its 10 passwords.
Since each of the directories contents would be critical, only few users need to access. :wall:
I need to write a script so that it creates 10 directories in no time.

So, how can i explicitly set a password to a directory?

create a group with those users and assign the permission to them only