how can i change the format of an image file to an unnormal format so that only my game could use it and no one could view it.
What’s the point?
You could create you own image format ;D or simplier make a few change to the images and only your would know what to do in order to undo the changes.
The changes should change depending on the image format but for the images with header you could move the header of the images from the beginnig of the file to the end, at loading you’d just have to move the header back at the beginning!
I have tried it.but it`s too slow because the files sizes are about 1.5Mb with resolution 4000 * 3000.
Well, it doesn’t make any sense to do that. Really.
Your art isn’t that great. Stuff like that happens so rarely… usually it’s done by people who need some test graphics… or sprite comics and well that’s about it.
Why should someone bother ripping your sprites if he/she can just get pre ripped capcom sprites from 1 min googling?
It just won’t happen. And if it would happen for some weird reasons you can sue em to hell. Maybe you have luck and they sold the game very well. Lot’s of cash for you and no additional work needed ;D
edit: Btw no one does that. Even the big companies don’t do that. They use a fast loading format and put everything into pack files, wich are either just zip or something similar. The reason for doing so isn’t to obfuscate the media - it’s for faster loading times. Seek time is minimized this way, because everything is next to each other and not cluttered around the whole hdd (fragmentation is to blame). In addition the overhead is minimized if you have lot’s of small files (clustersize is usually 4 or 8k) and thus alot of space can be saved.
what did you mean? Say it clearly.
Anyway thank you for second part of your message.
Say it clearly.
Don’t bother. It’s not worth the hassle.
Just rename the files to “image.raw” or so… if someone really wants to rip it he’ll stop at this point (if not a custom format won’t have helped you anyways).
It will still work with the wrong extension, because the java api doesn’t identify the filetype by it’s extension
edit: “.class” is a nice extension for that. Just call it “InitializeLaserShoe.class” ;D
[quote]You had best to see a doctor. >:(
[/quote]
?
Ahwell… go ahead… make your custom format. Who needs compression?
4000 * 3000 * 4 = 48 mb
Yea. Sounds really great. Go for it
Come on, some people feel their resources are worth protecting physically, its a mistake, but ok…
- Load up your image
- Write out the raster to a file
- Stick the raster in a zip file
- Use a ZipInputStream to read your file and recreate the raster.
- If you want to add some encryption/decryption just stuff a pattern on bytes across the raster output.
You’ll never perfectly protect your resources since you’ll have to publish the decoding method with your game (since it will need to use the resources). However, you’re much better protected by the legal system in place.
Kev
[quote][…]
- Load up your image
- Write out the raster to a file
- Stick the raster in a zip file
- Use a ZipInputStream to read your file and recreate the raster.
- If you want to add some encryption/decryption just stuff a pattern on bytes across the raster output.
[…]
[/quote]
Additional security over wrong extension = zero
In both cases you would go for a decompile. With wrong extension it’s “aaah that isn’t a class” and with that custom format… just a search for “thatimage.ext” and add a line ala:
ImageIO.write(thatImage, “png”, new File(“rippoff.png”));
et voila :
Didn’t helped at all. Of corse you can have tons of classes, a decrypted filename and obfuscation. What would you get? 2-3 mins more are needed then.
Lot’s of hassle for no effect. So… don’t bother.
Let me reinterate:
In case you missed it
However, some folks are sure its what they want to do, and they’d like an intricate method to do so…
Sorry, must be the beer talking…
Kev
its a mistake
nod nod
Well, I just wanted to point out that it’s wasted time and everything you’ll get in the end is slower loading times and bigger filesize. Oh and there is always a print key and programms wich take screenshots x-times per second.
Sorry, must be the beer talking…
Ye… well I’m kinda over tired. But the rendering will be done pretty soon now and I can (finally) go to bed
The companey has ordered this software, wants me to protect their photos of viewing normaly with other programs.Its the thing that they wanted me to do.it
s no defference for me to replacing some lines of picture or define a new format.Just want to be (just a little)secure and a bit fast.Now if anyone could help me Besmella.
thank you
Bung the files though an AES library to and from disk, that should be secure enough (just don’t use the rather crappy ECB mode). I’m sure there must be a java implementation out there somewhere you can use…
Well, as people have already said, you’ll stop most people just by changing the file extension.
If you want to obfuscate the image files, either run a XOR mask over the data or just clobber the format in some way. For BMPs, for example, this is as simple as breaking the first two bytes of the file - the “magic number”. If that doesn’t equal 474 (I think?), most image viewers will (should) give up.
Extra obfuscation can be done by encrypting things, as OrangyTang says. But remember that the decryption key will be held inside the program, thus available to anyone who goes looking for it.
If you want to encrypt the images such that people who decompile the software can’t access them, that’s a different matter. It’s very very difficult to do it in any language, and with Java in particular you’ll be looking at a hardware dongle, hash-codes for known JVMs, and a JNI library. And even then it won’t be guaranteed.
How much is the client willing to pay? And how skilled are the target consumers? If you’re talking about AOL users, web designers and secretarial staff, just change the extension. If you’re talking inquisitive males and piracy nuts, obfuscate the data and hope they don’t poke too closely, or go the encryption route and hope they don’t know how to use a decompiler. If you’re talking computer programmers or cryptographers, renegotiate terms with your client!
Hm… ok. The most obscure way would be putting the scrambled image data into the comment of the jar archive or appending it.
If we are talking about applets. Generate a temporary “ticket” (valid for <1 minute) serversided. Add is as param. Request a bzip2 archive from a php file, wich validates the ticked and the custom added weird referrer and agent. The bzip2 archive is a compression bomb (just for the fun of it) and the actual scrambled image data is appended.
A 100gb bzip2’ed bzip2 bomb for example is 220bytes in size
(Of corse people who trapped into that will really hate you/that company)
It`s an application and all the pix and the software would sell on One CD. Software secured by an unique serial number that has produced when the software was installing.and customers must tell company the serial no to get an username/password to install the software.