如何加密 .zip 文件?

发布于 2024-10-15 00:16:27 字数 223 浏览 2 评论 0原文

是否可以加密 Zip 文件?我知道加密用于使 .txt 文件在使用密钥解密之前无法读取。尽管我想对 .zip 文件执行相同的操作。
我希望用户通过我正在创建的程序从互联网下载多个文件,因此我想将它们压缩为 .zip 格式,然后加密 Zip 以增加安全性。 (我不希望用户在没有序列号的情况下访问 .zip 中的文件)
我打算将“序列号”保存在程序可以获得的在线数据库中。

是否以错误的方式处理这件事?

Is it possible to encrypt a Zip file? I know encryption is used to make .txt files unreadable until decrypted with a key. Although I want to do the same with a .zip file.
I have multiple files I want users to download from the internet through my program I'm creating, so I thought I'll compress them files in a .zip and then encrypt the Zip for added security. (I don't want users to access the file within the .zip without a serial code)
I was going to keep the 'serial key' in a database online which the program would get.

Am going about this in the wrong way?

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

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

发布评论

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

评论(3

冰魂雪魄 2024-10-22 00:16:27

DotNetZipSharpZipLib支持加密 zip 内容,并且免费。

Both DotNetZip and SharpZipLib support encrypting the contents of zips and are free.

所有深爱都是秘密 2024-10-22 00:16:27

使用 dotnetzip 库执行压缩/解压缩操作。

它支持 AES 加密。来自网站:

该库支持 zip 密码、Unicode、ZIP64、流输入和输出、AES 加密、多个压缩级别、自解压存档、跨区存档等。

Use the dotnetzip library to perform your zipping/unzipping operations.

It supports AES encryption. From the website:

The library supports zip passwords, Unicode, ZIP64, stream input and output, AES encryption, multiple compression levels, self-extracting archives, spanned archives, and more.

许你一世情深 2024-10-22 00:16:27

是的,您可以使用第三方 zip 库,如其他答案所示,但请记住,您保护文件的方法是基本的...在您的程序帮助解密文件后,观察您的程序操作并恢复文件并不是非常困难。如果您将密钥存储为程序中的常量,那么提取起来也非常简单。

软件保护是一个复杂的领域,很难阻止坚定的用户查看存储在他们控制的系统上的数据。商业软件竭尽全力来防止这种情况发生,而且解决方案也相当复杂。 (例如,尝试将调试器连接到 Skype,看看会发生什么)

Yes you can use third party zip libraries as shown by other answers, but keep in mind that your method of protecting files is rudimentary... it would not be terribly difficult to observe your program operating and recover the files after your program helpfully decrypts them. If you are storing the key as a constant in the program, that is pretty trivial to extract as well.

Software protection is a complex field, and it's very difficult to prevent determined users from viewing data that is stored on systems they control. Commercial software goes to great lengths to prevent this, and the solutions are quite complicated. (e.g. try hooking a debugger to Skype and see what happens)

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