Create password protected archives from the terminal

You can easily protect archives created in the terminal in macOS. If you want to create a zip file of the folder archiveMe you can run the command

zip -er archiveMe

where the option e tells the command to encrypt the zip file, and r tells the command to recurse into directories.

The command will wait for you to input the password (twice) before creating the archive.