“加密”供稍后阅读的文件/文件夹

发布于 2025-01-04 02:46:30 字数 280 浏览 1 评论 0原文

我有一个文件夹。带文件夹。带文件(主要是.png)。

出于学习目的,我尝试创建一个应用程序,该应用程序将获取该文件夹并将其“编译”在一个数据文件中。就像一个.bin。关键是,用户无法轻松地查看或编辑图像。

将来,我的应用程序可以打开此类数据文件并读取文件夹的内容,还可以显示在文件夹中找到的图像(使用 Image.fromFile("pathForTheFile") 或类似的东西)。

这可能吗?是否可以将文件夹/图像甚至音频“加密”或“编译”到一个文件中,并在将来使用 VB.NET 重新读取它?

I have a folder. With folders. With files (mainly .pngs).

For learning purposes, I am trying to create an application that will take that folder and "compile" it in one single data file. Like a .bin. The point is, the user can't see or edit the images... easily.

And in the future, my application can open such data file and read the folder's contents, and also display the images found within the folder (using Image.fromFile("pathForTheFile") or something like that).

Is that possible? Is it possible to "encrypt" or "compile" folders/images or even audio into one file and re-read it in a future using VB.NET?

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

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

发布评论

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

评论(2

小草泠泠 2025-01-11 02:46:30

您可以实现此 MSDN 文章中的一些示例来完成您想要的操作:http://msdn.microsoft.com/en-us/library/aa719106%28v=vs.71%29.aspx

You could implement some of the examples in this MSDN article to do what you are looking for: http://msdn.microsoft.com/en-us/library/aa719106%28v=vs.71%29.aspx

指尖微凉心微凉 2025-01-11 02:46:30

这取决于您希望该机制的安全程度。如果你不写 .zip 扩展名,仅仅压缩它(就像贾斯汀建议的那样)就足够了。但这根本不安全,任何仍然尝试使用 Zip 客户端打开“编译”文件的人都将拥有完全访问权限。

您可以在使用简单的算法重写到光盘之前打乱二进制文件,例如反转某些字节的顺序。然后,您在读取文件时将执行相反的操作。它会减慢或者可能阻止人们尝试操纵文件。

如果您想要真正的安全性,您将需要一些公钥/私钥算法。您可以在应用程序中使用一些 API。快速的 Google 搜索给了我一些信息,例如 http://www.bouncycastle.org/csharp/

另一种方法是将图像存储在数据库中,并像其他项目一样保护数据库的安全。

It depends on how much secure you want the mechanism to be. Just zipping it (like Justin suggested) could still be enough, if you don't write the .zip extension. But that is not secure at all, anybody who still tries to open the "compiled" file with a Zip client will have full access.

You could scramble the binary before rewriting to disc with a simple algorithm, like reversing the order of some bytes. You would then do the opposite move when reading the file. It's gonna slow down or maybe stop people from trying to manipulate the file.

If you want real security, you will need some Public Key/Private Key algorithm. There are some APIs you can use within your app. A quick Google search gave me some, like http://www.bouncycastle.org/csharp/.

Another way around would be to store your images in a database, and secure your database just like for any other project.

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