GZipStream can be used to create a .gz file, but it is not the same as a .zip file.
To create password protected zip files, I think you need to go to a third-party library.
Here's how to do it using DotNetZip ...
var sb = new System.Text.StringBuilder(); sb.Append("This is the text file..."); foreach (var item in listOfStrings) sb.Append(item);
source share