On Mac/Linux to zip/unzip password protected zip files, I use: Zip:
zip -P password -r encrypted.zip folderIWantToZip
Unzip:
unzip -P password encrypted.zip
What are the equivalent command on Windows on the command line (assuming that 7zip has been installed)?
I have been doing research and found that it is not possible to password encrypt using the Java zip4j library. Also Windows does not have a zip command prompt like Mac/Linux
From the "Archive format" field, select zip. Under the "Encryption" section, enter a strong password or passphrase in the "Enter passphrase" field and again in the "Reenter passphrase" field. Ensure the "Encryption method" is AES-256. Onced finished, click OK.
Microsoft Windows Vista, 7, 8, and 10 users Select the file or folder you want to encrypt. Right-click the file or folder and select Properties. On the General tab, click the Advanced button. Check the box for the "Encrypt contents to secure data" option, then click OK on both windows.
7-Zip, like WinZip, creates a container called archive that holds the files to be protected. That archive can be encrypted and protected with a password. 7-Zip is a free software that creates Zip files that can be opened with WinZip or other similar programs.
From http://www.dotnetperls.com:
7z a secure.7z * -pSECRET
Where:
7z : name and path of 7-Zip executable a : add to archive secure.7z : name of destination archive * : add all files from current directory to destination archive -pSECRET : specify the password "SECRET"
To open :
7z x secure.7z
Then provide the SECRET password
Note: If the password contains spaces or special characters, then enclose it with single quotes
7z a secure.7z * -p"pa$$word @|"
General Syntax:
7z a archive_name target parameters
Check your 7-Zip dir. Depending on the release you have, 7z may be replaced with 7za in the syntax.
Parameters:
Eg. This will prompt for a PW and hide file structures:
7z a archive_name target -p -mhe=on
Eg. No prompt, visible file structure:
7z a archive_name target -pPUT_PASSWORD_HERE
And so on. If you leave target blank, 7z will assume * in current directory and it will recurs directories by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With