Script needed to encrypt a zip file

I would like to run a script, which will look at a specific folder in a path (ie C:\users\user1\desktop\desktop.zip), and encrypt that zip file with a password.
is this possible, please let me know.
100questionsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ITguy565Commented:
I would use something like the following :
https://gallery.technet.microsoft.com/scriptcenter/EncryptDecrypt-files-use-65e7ae5d

#Create Key
$key = New-CryptographyKey -Algorithm AES
 
#Encrypt the file
Protect-File '.\secrets.txt' -Algorithm AES -Key $key -RemoveSource
 
#Decrypt the file
Unprotect-File '.\secrets.txt.AES' -Algorithm AES -Key $key -RemoveSource
ITguy565Commented:
Did that work for you?
AlanConsultantCommented:
Hi,

Probably worth noting that you can encrpyt a zip file when it is created, so you don't need to do it separately.

7-Zip (for example) allows AES-256 encrpytion, with a password based key.

Alan.
Virus Depot: Cyber Crime Becomes Big Business

The rising threat of malware-as-a-service is not one to be overlooked. Malware-as-a-service is growing and easily purchased from a full-service cyber-criminal store in a “Virus Depot” fashion. View our webinar recording to learn how to best defend against these attacks!

ITguy565Commented:
@100Questions:

Did you get a chance to test?
Gerwin Jansen, EE MVETopic Advisor Commented:
Already suggested by Alan, a command you can use for 7zip command line:

<path to executable>\7z a C:\users\user1\desktop\desktop_protected.7z C:\users\user1\desktop\desktop.zip -pSECRET

SECRET is your password

You can add the optional -sdel parameter at the end to remove the .zip file once the .7z file has been created.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AlanConsultantCommented:
Good options provided.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.