How to encrypt txt files with AES256 via Windows 7z command line?

I have 7z on windows , and I want to encrypt 1 txt file with AES256 via 7z command line.

How can I do it please?

2 Answers

To make the answer simple just use the switch -p which means Set Password with the default encryption which is AES.

The example below will encrypt the file or folder and prompt for a password:

  • 7z a -p Zip_File_Name File_2_zip.txt

The following example will auto add the password to the file for you.

  • 7z a -pPassword Zip_File_Name.7z File_2_Zip.txt

The other switches used above are:

7z a -p -mhe=on Zip_File_Name.7z File_2_Zip.txt -pPassword == Auto add password without being prompted -mhe=on == Means to encrypt the file names in archive too.
0
7za u -mx -mhe -pPASSWORD ARCHIVE-FILE-NAME.7Z SOURCE-FILE-SPEC

Any time you use the .7z format, the file is AES-256 encrypted.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like