命令行大全

zipcloak

嚯嚯 发表于 2020-07-08 18:30浏览次数:

zipcloak 加密现有zip 归档文件中的文件。本文档介绍zipcloak的Linux版本。

查看英文版

目录:

1 zipcloak 运行系统环境

2 zipcloak 描述

3 zipcloak 语法

4 zipcloak 示例

zipcloak 运行系统环境

Linux

zipcloak 描述

可以使用两种方式对使用zip实用工具创建的档案进行加密:在存档时使用zip--encrypt选项,或者在使用zipcloak实用工具创建zip文件之后。

假设您有一个zipfile archive.zip,其中包含两个文件file1file2,并且您希望对其内容进行加密,以便只有知道密码的用户才能提取其内容。您可以使用以下命令对zipcloak执行此操作

zipcloak archive.zip

zipcloak将提示您输入密码,然后要求您确认密码:

Enter password:  
Verify password:

...如果密码匹配,它将加密存档中的每个文件:

encrypting:file1 
encrypting:file2

...现在,当您尝试解压缩归档文件时,它将提示您输入密码,然后再允许您提取其中包含的文件:

unaip archive.zip
Archive:archive.zip 
[archive.zip] file1 passwrod:

尽管它要求输入“ file1密码 ”,但您只需输入一次密码即可解密并提取存档中的所有文件。

从存档中删除加密

以后,如果您希望从zip文件中删除加密,则可以使用zipcloak-d选项,如下所示:

zipcloak -d archive.zip

然后zipcloak会要求您提供用于加密zip文件的密码:

Enter passwor

...如果输入正确,zipcloak将从档案中的文件中删除加密:

decrypting:file1 
decrypting:file2

...然后返回到命令提示符。

将加密的存档输出到新文件

您还可以选择不对原始存档进行加密,而是创建存档的新加密版本。假设您原始的未加密存档名为archive.zip,并且您想要创建一个加密版本的存档,称为crypto.zip,而原始文件保持不变。您可以使用zipcloak-O选项来完成此操作。运行以下命令:

zipcloak archive.zip -O crypto.zip

...并且zipcloak将照常运行,除了代替对原始档案进行加密之外,它会创建一个新的加密版本的档案(称为crypto.zip)

技术说明

zipcloak会加密指定zip文件中的所有未加密条目,这是默认操作。

-d选项用于在压缩文件解密加密的条目。

该程序的加密代码无版权,属于公共领域。它最初是在欧洲编写的,可以从包括美国在内的任何国家免费发行。(以前,如果将此程序导入到美国,则无法将其从美国重新导出到另一个国家。有关更多信息,请参见源分发中包含的README.CR文件。)否则,适用Info-ZIP许可证。

请注意,zipcloak不支持大于2 GB的档案。

Archives created with the zip utility can be encrypted in two ways: by using zip's --encrypt option at archive time, or after the zipfile is created by using the zipcloak utility. 

Let's say you have a zipfile archive.zip which contains two files, file1 and file2, and you'd like to encrypt its contents so that only users who know the password can extract its contents. You can do this with zipcloak using the following command:

zipcloak archive.zip

zipcloak will prompt you for a password, and then ask you to confirm it:

Enter password: 
Verify password:

...if the passwords match, it will encrypt each file in the archive:

encrypting: file1
encrypting: file2

...and now, when you try to unzip the archive, it will prompt you for the password before allowing you to extract the files it contains:

unzip archive.zip
Archive:  archive.zip
[archive.zip] file1 password:

Although it asks for "file1 password", you only need to enter the password once to decrypt and extract all of the files in the archive.

Removing Encryption From The Archive

Later, if you wish to remove the encryption from the zipfile, you can use the -d option of zipcloak, like this:

zipcloak -d archive.zip

zipcloak will then ask you for the password that was used to encrypt the zipfile:

Enter password:

...and if you enter it correctly, zipcloak will remove the encryption from the files in the archive:

decrypting: file1
decrypting: file2

...and return you to the command prompt.

Outputting The Encrypted Archive To A New File

You also have the option of leaving the original archive unencrypted, and creating a new encrypted version of the archive instead. Let's say your original, unencrypted archive is named archive.zip, and you want to create an encrypted version of the archive called encrypted.zip, leaving the original file unchanged. You could use zipcloak's -O option to accomplish this. Run this command:

zipcloak archive.zip -O encrypted.zip

...and zipcloak will operate as usual, except that instead of encrypting the original archive, it will create a new, encrypted version of the archive named encrypted.zip.

Technical Description

zipcloak encrypts all unencrypted entries in the specified zipfile, which is the default action.

The -d option is used to decrypt encrypted entries in the zipfile.

The encryption code of this program is not copyrighted and is in the public domain. It was originally written in Europe and can be freely distributed from any country including the United States. (Previously, if this program was imported into the U.S., it could not be re-exported from the U.S. to another country. See the file README.CR included in the source distribution for more information.) Otherwise, the Info-ZIP license applies.

Please note that archives larger than 2 gigabytes are not supported by zipcloak.

zipcloak使用原始的zip加密,与现代算法相比,该加密被认为很弱。

zipcloak uses original zip encryption, which is considered weak in comparison to modern algorithms.

查看英文版

查看中文版

zipcloak 语法

zipcloak [-d] [-b path] [-h] [-v] [-L] zipfile 
Options
-b path

--temp-path path
将路径指定的目录用于临时zip文件。
-d

--decrypt
解密加密的条目(如果密码错误,则复制)。
-h

--help
显示帮助消息,然后退出。
-L

--license
显示软件许可信息,然后退出。
-O newfile

--output-file newfile
将输出写入新档案newfile,保留原始档案不变。
-q

--quiet
安静地操作,禁止显示一些参考消息。
-v

--version
显示版本信息,然后退出。
zipcloak [-d] [-b path] [-h] [-v] [-L] zipfile 
Options
-b path

--temp-path path
Use the directory given by path for the temporary zip file.
-d

--decrypt
Decrypt encrypted entries (copy if given wrong password).
-h

--help
Display a help message, and exit.
-L

--license
Display software licensing information, and exit.
-O newfile

--output-file newfile
Write output to new archive newfile, leaving original archive as is.
-q

--quiet
Operate quietly, suppressing some informational messages.
-v

--version
Display version information, and exit.

查看英文版

查看中文版

zipcloak 示例

zipcloak myarchive.zip

加密myarchive.zip文件。该zipcloak命令会提示你输入密码,然后要求你进行确认; 如果它们匹配,它将加密文件,以便没有该密码就无法解密。

zipcloak myarchive.zip -O encrypted.zip

加密档案内容myarchive.zip,但写的加密档案文件到一个新的文件,encrypted.zip,并留下myarchive.zip加密。

zipcloak -d myarchive.zip

使用zipcloak删除以前放在myarchive.zip上的所有加密。在删除加密之前,系统会提示您输入密码。

zipcloak myarchive.zip

Encrypt the myarchive.zip file. The zipcloak command will prompt you to enter a password, then ask you to confirm it; if they match, it will encrypt the file so that it cannot be decrypted without that password.

zipcloak myarchive.zip -O encrypted.zip

Encrypt the contents of archive myarchive.zip, but write the encrypted archive to a new file, encrypted.zip, and leave myarchive.zip unencrypted.

zipcloak -d myarchive.zip

Remove any encryption previously placed on myarchive.zip using zipcloak. You will be prompted for the password before it will remove the encryption.

查看英文版

查看中文版