Here we take a look at password protecting any file or folder on macOS. This will work on any recent version of macOS.
Step by step break down
Add Terminal to allowed apps full disk access
change to directory where file is located
zip -er [drag folder in and add .zip to the name.] [drag folder in and leave as is] then give a secure password. ]
zip -e [drag file in and add .zip to the name.] [drag folder in and leave as is] then give a secure password ]