zip 加密

https://www.2daygeek.com/zip-7zip-encrypt-decrypt-password-protect-files-folders-linux/
sudo apt-get install zip unzip

# zip --encrypt test.zip test.txt test1.txt
Enter password: ******
Verify password: *****
  adding: test.txt (stored 0%)
  adding: test1.txt (stored 0%)

Details :

zip : Command
–encrypt : To create encryption
test.zip : Zip file name
test.txt & test1.txt : These are files to be encrypted

To unzip encrypted zip file, just run the following command and input the password once.

# unzip test.zip
Archive:  test.zip
[test.zip] test.txt password: ******
replace test.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
 extracting: test.txt
replace test1.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
 extracting: test1.txt

For floder encryption use -r option with zip command. In this example, we are going to create a encrypted zip file called test1.zip with test.txt, test1.txt file & test-dir folder.

# zip -r --encrypt test1.zip test.txt test1.txt test-dir/
Enter password: ******
Verify password: ******
  adding: test.txt (stored 0%)
  adding: test1.txt (stored 0%)
  adding: test-dir/ (stored 0%)
  adding: test-dir/test1.txt (stored 0%)
  adding: test-dir/test.txt (stored 0%)

To unzip encrypted zip folder, just run the following command and input the password once.

# unzip test1.zip
Archive:  test1.zip
[test1.zip] test.txt password: ******
replace test.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
 extracting: test.txt
replace test1.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
 extracting: test1.txt
replace test-dir/test1.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
 extracting: test-dir/test1.txt
replace test-dir/test.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
 extracting: test-dir/test.txt
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,198评论 19 139
  • VC++、MFC最好的开源项目 介绍:介绍一下用VC++/MFC写的最好的开源项目。 Sourceforge.NE...
    Allan_Zeng阅读 1,035评论 0 2
  • 1.创建文件夹 !/bin/sh mkdir -m 777 "%%1" 2.创建文件 !/bin/sh touch...
    BigJeffWang阅读 10,238评论 3 53
  • 日常经常遇到zip压缩包没有密码或忘记密码无法解压的情况,基于以上情况可能需要对压缩文件密码进行枚举暴力破解该密码...
    _String_阅读 5,906评论 0 1
  • 全称 -> 缩写 ABA -> ABA ABANDONED -> ABNDND ABBREVIATED -> AB...
    liuliuzo阅读 4,610评论 3 1