Following C# code shows how to create a password protected ZIP file and add files to it.
// create new ZIP archive
using (ZipArchive zip = new ZipArchive(@"C:\archive.zip", ArchiveOpenMode.Create))
{
// set the Password first
zip.Password = "PASSword#123";
// now add all files from the folder c:\data
zip.Add(@"C:\Data");
}