如何加密资源文件? [英] How To Encrypt Resource Files?

查看:221
本文介绍了如何加密资源文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用Java和Slick2d制作的游戏,我有一个包含我所有资源(图像,声音等)的文件夹,我想知道如何加密它们,以便人们无法编辑它们?我尝试过MD5,但是我并不确定它是如何工作的,我并不担心人们进入代码,因为我将该jar拼接成一个exe文件。另外,如果我需要知道如何解密这些文件,以便在代码中使用它们也可以解释一下。

解决方案

没有办法保护图像/资源,所有你可以做的是使它稍微更难。如果您将图像/资源传递给客户端,那么他们可以随时解密,所有客户端必须在某个时间点显示他们未加密。



tw:MD5是一个哈希算法,它用于检查数据是否没有损坏。


Hi I have a game made in Java and Slick2d and I have a folder that contains all of my resources (images, sounds, etc) and I was wondering how to encrypt them so people can't edit them? I tried MD5 but I'm not really sure how it works and I'm not worried about people breaking into the code because I have spliced the jar into an exe file. Also if I need to know how to decrypt the files so that they can be used in the code please explain that too.

解决方案

There is no way to protect the images/resources, all you can do is make it slightly harder. If you deliver your images/resources to the client then they can always decrypt them, after all the client has to display them unencrypted at some point in time.

Btw.: MD5 is a hash-algorithm, it is used to check if data is undamaged.

这篇关于如何加密资源文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆