Using Spotlight, type in Terminal.
Change your directory to the location of your folder. For example, in my instance, I would type cd /Volumes/dataMAC and hit enter.
Type in ls to make sure you see your folder.
Now type in the command that will simultaneously compress and password protect the files in the form of zip -er FILENAME.zip FILESorFOLDERStoCOMPRESS.
➡️ In my example, that would be zip -er Mytaxes.zip ForTaxes/. ⬅️
Hit return/enter.
Next, you'll be prompted with a password prompt—type in the password you want to use to protect the files. Enter the password twice.
You should now see your compressed and password-protected zip file in Finder.
You can test the protection by double-clicking the file.
Enter your password. The file will be uncompressed into the same directory