Password Protecting a File

hello there. Is there a way to password protect a file and make it so that several passwords can open it?

i'm trying to write a script that open up a file if the password given by a user is one of many other passwords in the database of the file.

not sure if this is possible. thanks

the system i'm running is a Linux Red Hat system.

Is there a reason why you cannot create a group, chgrp the file to the group, and put users who need to read the file in the group?

You can look into the UNIX crypt command that will password protect your
file, but it only uses on password.

crypt key < clear.file > encrypted.file