“腐败” zip 文件而不是密码保护

发布于 2024-12-04 16:54:25 字数 261 浏览 1 评论 0原文

我开发了一个 Android 应用程序,它从网络接收受密码保护的 zip 文件。 其想法是保护这些 zip 文件中的内容免遭提取和复制。 但存在一个问题 - 在手持设备上提取受密码保护的文件需要很长时间(约 30 秒)。我使用 zip4j 库 - 我发现的唯一用于提取受密码保护的档案的库。

我有一个主意。这个想法是传输“损坏的”存档,例如,文件中间的几个字节将被反转。在提取之前,这些字节将再次反转,我将能够快速提取存档。

问题:我的存档中的数据可以通过这种方式得到保护吗?

I develop android application that receives password-protected zip-file from the network.
The idea is to protect content in these zip-files from extracting and copying.
But there is an issue - extracting password-protected takes long time (~30 sec) on handheld devices. I use zip4j library - the only library I found for extracting password-protected archives.

I have an idea. The idea is to transmit "corrupted" archive, where several bytes in the middle of file will be reversed, for example. Before extracting these bytes will be reversed again, and I will be able to extract archive quickly.

The question: can my data inside the archive be protected this way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光与爱终年不遇 2024-12-11 16:54:25

通过更改 Zip 中间的随机字节,您可能会在 Zip 中创建一个文件,以便在解压缩过程中出现 crc 错误(从而变得“损坏”),但其他文件可能可读,甚至所有文件至少部分可读。
您可以考虑以某种方式“加密”Zip 目录,该目录存储在 Zip 文件的末尾。无论如何,Zip 文件还有另一个每个文件的标头块,这些标头块可能会被某些 zip 修复工具“修复”,因此您还必须对这些标头块进行加密。
考虑寻找更好的 Zip 库来读取有效的 AES 加密 Zip 文件。

By changing random bytes in middle of Zip, you'll probably make one file in Zip to get crc errors during decompressing (thus become "corrupted"), but other files may be readable, or even all files would be readable, at least partially.
You may consider to somehow "encrypt" Zip directory, which is stored at end of Zip file. Anyway, Zip file has another per-file header blocks which may be "fixed" by some zip fix tools, so you'd have to encrypt also these.
Consider to find a better Zip library for reading valid AES encrypted Zip files.

清君侧 2024-12-11 16:54:25

根据 zip 文件内的数据内容,您可能可以采用不同的方法。您是否考虑过以不同的方式加密文件。

例如,我做了一个项目,其中显示了一小段信息。收集的片段需要时间来整理,因此具有一定的价值,我不希望任何人简单地获取这些信息。每个片段都是一行文本。我没有用密码保护整个文件,而是加密了文件中的每一行。每行的描述对于用户来说是快速且不可见的。

另外,请考虑 zip 文件密码保护并不安全。在线提供 zip 文件破解工具,可以很好地打开该文件。

Depending on what the data inside the zip file is, a different approach may be possible for you. Have you considered encrypting the file differently.

For example, I did a project in which I was displaying small snippets of information. The collection of snippets took time to collate and as such had some value and I didn't want anyone simply taking the info. Each snippet was a line of text. Rather than password protect the whole file, I encrypted each line in the file. The de-cription of each line was quick and invisible to the user.

Also, consider that the zip file password protection is not secure. There are zip file cracking tools available on-line which will have a good go at opening the file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文