Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

KuroKage

How exactly could I encrypt bitmap files in my game???

This topic is 5231 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

HI, First of, I''m not sure if "encrypt" is the right term to use but here''s what I''m getting into. I have a bitmap folder in my game that contains all things graphical (character/enemy frames, tiles, menus etc.), but the thing is, when I give a copy of it to my friends, I don''t want them to access the bitmap files individually. Is there any way that I can "encrypt" my bitmap files so that accessing them is impossible? THANKS IN ADVANCE!!

Share this post


Link to post
Share on other sites
Advertisement
Indeed you can. Writing your own encryption program is fun! I think there are many articles about this one everywhere, just use google.

Share this post


Link to post
Share on other sites
It is never impossible. However, you can make it difficult by stripping out all the header information and just store the bitmap data. On top of this you could also compress the bitmap by using run-length encoding. It is simple and will throw off any casual attempts. Also change the extension to something of your own invention.



First make it work, then make it fast. --Brian Kernighan

The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)

Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte

[edited by - CaptainJester on March 23, 2004 5:52:52 AM]

Share this post


Link to post
Share on other sites
Rename the folder they are stored in as ''Sounds'' and change the file extension to ''.wav''. You can also rename your ''Sounds'' folder ''Images'' and change all the sound files to .bmp.

Your loader program will know that the file extensions are switched around, and be able to load them properly. Your friends however, will be baffled that none of the .bmps load properly.

Alternatively, you could include the files in a resource. (either in the main exe or in a resource dll) Unless they have access to a resource editor or are prepared to start messing around with hex editors, the chances are they won''t be able to mess with your files.

Share this post


Link to post
Share on other sites
quote:
Original post by CaptainJester
It is never impossible. However, you can make it difficult by stripping out all the header information and just store the bitmap data. On top of this you could also compress the bitmap by using run-length encoding. It is simple and will throw off any casual attempts. Also change the extension to something of your own invention.



If you''re going to store the image data without image RLE compression, adding a little bit of text like "MYBITMAP" at the start of the file will prevent them from easily being able to load them as a RAW image in Paint Shop Pro.


.:Cubicle2:.

Share this post


Link to post
Share on other sites
Allow me to ask the question: Why?

Modding games is incredibly popular these days, and I think that any good game design will support user modification and user-created content. Or is there some particular reason why you''d go to all this trouble?

Share this post


Link to post
Share on other sites
If you don''t want to support modding and you want to protect your artwork from being changed/stolen. Although they will eventually be able to rip your graphics and/or change it, encrypting/storing them in 1 huge file is generally a good idea.

Read this article on how to create a PAK file:
http://www.gamedev.net/reference/articles/article1991.asp

Toolmaker



-Earth is 98% full. Please delete anybody you can.

Share this post


Link to post
Share on other sites
I''ve been thinking a similar question, so thanks everyone for replying. As far as WHY someone at this level would want to encode the bitmaps, it''s simple. Modding is great when it''s obvious that people know who did most of the groundwork on the engine, but when you''re starting out, just writing a simple Tetris game is a lot of work to a new person. Imagine how much it would suck if someone downloaded your game that you cut your teeth on, took out your name on the loading screen, changed some graphics around and called it their own? And they could get away with it too because the game is so simple most people wouldn''t question it.

Also, having encoded files looks a bit more professional than just having bitmaps in a folder, as well as using compression allows you to distribute it easier.

In my case, I plan to create a tool to allow someone to mod the graphics and such, but with built in safeguards to still display that I did the underlying work.

Share this post


Link to post
Share on other sites
quote:
Original post by lukeyes
Modding is great when it''s obvious that people know who did most of the groundwork on the engine, but when you''re starting out, just writing a simple Tetris game is a lot of work to a new person.
But encrypting your resources obviously isn''t?

quote:
Imagine how much it would suck if someone downloaded your game that you cut your teeth on, took out your name on the loading screen, changed some graphics around and called it their own?
It''s a Tetris clone; who cares? That person hasn''t learned anything, but you have, and you''ll go on to greater heights while they''ll continue trying to pass other people''s work off as their own.

Besides, with the number of freely available implementations of several games with source, this scenario is about as likely as an elephant becoming a Mariachi singer.

quote:
Also, having encoded files looks a bit more professional than just having bitmaps in a folder...
Nope. Besides, if you''re a beginner, why are you concerned about "looking professional"? It''s still just a Tetris clone.

quote:
...as well as using compression allows you to distribute it easier.
Use InstallShield or NSIS and make an installer.

quote:
In my case, I plan to create a tool to allow someone to mod the graphics and such, but with built in safeguards to still display that I did the underlying work.
Entertaining. Perhaps gratifying and ego-inflating, but ultimately pointless.

Allow me to explain my rationale: Dijkstra said that "premature optimization is the root of all evil." While this is, of course, a somewhat farcical statement, it has a definite ring of truth to it, and it extends beyond mere source code. If you''re building encryption to learn encryption, good. If you''re writing compression algorithms to grok compression, excellent. If, however, you''re incorporating these features for the sole purpose of "locking down" your Tetris clone, you''re wasting your time (and my processing power). Too frequently we get beginners (this is For Beginners, right?) misled by those who think they are advanced into squandering time and effort on low-return activities, like writing a game engine when they really should be writing the game.

Share this post


Link to post
Share on other sites
The truth is, even if someone would want to steal a beginner (with all due respect!)''s Tetris clone and claim it for their own, how would it affect you? For one thing, let''s face it: there are so many Tetris clones out there, you won''t make a name for yourself with yet an other one, so why worry about fame? For an other, in the end someone could just use print screen and extract your graphics manually from the game at runtime.

Get the game to work. Like previously stated, premature optimization is the root of all evil: you don''t even have a working game yet (I''m guessing?) so why focus on a feature that doesn''t serve any important purpose to the game itself?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!