Hey :P
I want to learn how to encrypt my pictures, then read them with rgss XD
There's any way to do that?
I really need this because I want to make projects(rmxp for example) more secure :P
Well its possible, requires coming up with your own algorithm. However, its not going to stop people from getting your graphics as they can still extract Scripts.rxdata and reverse the algorithm.
There is all types of ways to do such things. You can write a custom little script that simply scrambles the binary data, and then modify the RPG::Cache.load method to reverse the process. You still come back to the problem of a weak encryption by RMXP that will allow people to view your encryption/decryption methods.
If your using images, and are using a consistent file type, you can also think about removing the headers from the binary files. These will make it so that the pictures cannot be opened, and you would only need to have the load method add the header back on before using it. This will be a lot faster than decrypting an entire image. Look into this (http://forum.chaos-project.com/index.php/topic,9426.0.html) script and check out how some of the binary data is organized.
Well, they I'd make a nice algorithm XD so they would need 10000000000000000000 years to reverse it oO
But how do I start?
@Edit ninja xD
Hm...that script basically 'makes' my pictures into pieces? XD
He's referring to the Zlib module, it contains header info for graphic files.
I think there's a general misconception about encryption. There is no way to stop people from looking at your game's resources. Even commercial games on the PS3 or PC have this same 'problem'.
what's an 'header info' first? xD
And...How would I reverse the method on load_bitmap method?
I mean, obviously i would have to reverse the algorithm...but firstly, how would i make it and make it into pictures?
And btw, can't i encrypt scripts.rxdata as well?
No need dude. Just put a thing saying they aren't allowed to use it and you are safe. If they use it you can sue them and get rich ;)
hm...well...<.< that would happen if i find someone using that graphics lool!
still needing help >.<
...still an utterly worthless task since the decryption method can be viewed by anyone...
well nubs would'nt u.u
If they are capable of decrypting your archives to get to the encrypted picture files, it is a simple matter to find your decryption method and exploit it.
I think a bit of more secure won't prejudice the game =/
And anyway, i'd like to learn how to do it as well xD
so it's a start i think... xD
Well, first you may want to learn more about scripting. You will need to get the basics down before you can learn some more advanced stuff.
You also will need to decide on what method you want to use. There are plenty of ways of screwing up the binary data so that it won't open as an image, which can be de-scrambled when you want to read it. I created a method before that used a string password converted to a char array and uses that as salt to shift the bits on each byte in the file. It used the remainder left over from the shift, and applied it to the next byte, which would make it so that each shift affected the one after it. You weren't cracking it without the same string passed to the reversal process. This method was very inefficient and is not a very good idea, since it is exceedingly slow to iterate every byte in file and convert it every time you want to read it. DO NOT DO IT THIS WAY.
If you are only concerned with stopping novices, the easiest and least performance effecting way would be to remove the headers from all your files like I mentioned above. Modify RPG::Cache.load to add the headers back to the files before attempting to read them. If this is too complicated, then like I said, get some of the basics learned well first. Its a waste of both our times trying to learn something you won't understand. Its kinda like trying to learn long division before you know simple subtraction. You have to understand the first one to be able to know the second.
well, i already know the basics XD
What i dont know, it's what you say about binary headers :P
As i never worked with this type of stuff before(encrypting), it's kinda normal that i don't know exactly what to do..
The headers are used in different image formats, nothing to do with encryption. You have to know how to use Array#pack to create the data correctly. I'll explain a bit more later, I'm at work right now.
1. File->Compress Game Data
2. Check 'Create Encrypted Archive'
You are done. RMXP handles the encryption and decryption transparently.
*hugs*
That's what I've been trying to explain.
If you can get past that, the pictures will be able to be decrypted very easily, so individual encryption for the files using Ruby is quite useless.
But I mean....nowadays there is a descriptor program =/ So, if I just rmxp encrypt, it'll be easily 'open' <.< xD
I know its quite useless since they can see the encryption methods, but to newbies, rmxp compress won't be a matter i think...since they can have the vgfgs program...
Yet, I found this link:
http://forum.chaos-project.com/index.php?topic=132.0
Its Bitmap2Code by blizzard... Guess it's something that will protect a bit more the pictures?
Not even close.
It simply creates the bitmaps by using the Bitmap class instead of loading from file. Its really only good for small images. The code is still written in standard RGSS syntax that even a beginner with very basic understanding of scripting could read.
hm.. =/ I don't have any ideas then XD
How should i remove the pictures headers ?
Bitmap2Code was intended for small images. If you used it for all your big images, it would take way too long to load an image.