Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Encrypt your assets

Author
Message
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 22nd Apr 2013 15:37 Edited at: 24th Apr 2013 01:45
There are many ways to encrypt your data so that most user will never be able to to get at it:

http://www.youtube.com/watch?v=GFvtz5e32zo

The second video shows the code:

http://www.youtube.com/watch?v=XoI8csvuwRk

I can make tools to do this if anybody thinks it's worth bothering!

ADDITION: 24/04

Here's another technique. This joins files together:

http://youtu.be/NY7JB7_X9SU

Try wombat.wav

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL

Attachments

Login to view attachments
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 22nd Apr 2013 16:12
I'd appreciate you doing all the work for me LOL
Thanks for the offer, Jim!

Check out dFenz on Google Play, Windows, or Mac:
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 22nd Apr 2013 16:19
@Naphier - no problem. You can always pop over to Cape Coral and have a beer with my brother!

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Apr 2013 16:21
Very cool!

I've done a variety of encryption/decryption things in PHP and Javascript for site security issues. And made sure that the functions in the two languages can decrypt what is encrypted in the other language. Basically this has been applied to strings.

I like the idea of applying it to images. Your basic methodology is quite simple and nice.

The AppGameKit memblocks are almost good enough for the process for Tier 1. There needs to be a CreateMemblockFromFile function that would load an entire file into memory without worrying about content. And its opposite function - WriteMemblockToFile. (Of course, functions are relatively easily created for these.)

For Tier 2, all the basic file functions exist to support this as well.

I just might consider this for my next project. Then I might consider Windows publication of my apps.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 22nd Apr 2013 19:48
Show tgc how to do it so we get it natively in to agk

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Grumpy Jedi
14
Years of Service
User Offline
Joined: 16th Jan 2010
Location:
Posted: 22nd Apr 2013 19:58
It would seem to me that encrypting assets especially when dealing with sales of mobile games on a global scale we'd just be adding extra work for ourselves since now we'd have to deal with export restrictions.

Speaking of which, with all the new libraries and things that have been added to AppGameKit, Facebook,Twitter,and Game Kit SDK's, do Tier 1 compiled projects now contain encryption we would have to worry about in that regard?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Apr 2013 20:22
Grumpy Jedi, you sound like you've had to deal with ITAR before. It's a b**ch, ain't it?

And your question is a valid one for USA developers.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 22nd Apr 2013 20:37
Restrictions are easily coped with: leave the header intact and scramble the actual data zone.

Using a more advanced version of the XOR routine you could add a water-mark to images and various pings and lavatory-flushing sounds to audio.

I'd be surprised if many games were subject to ITAR problems.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Apr 2013 20:45
Quote: "I'd be surprised if many games were subject to ITAR problems."

Me too.

But, in theory, any app with heavy duty encrypting and decrypting functionality, even if it isn't actually available to the user, might be subject to export restrictions.

I don't know if the Facebook, etc. SDKs being added to AppGameKit contain anything questionable.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 22nd Apr 2013 21:48
For me would a low level encryption that simple stops the average joe to steal your media as soon as you release your game.

Google play is full of games with stolen media

Probably because google dont check the uploads as much as the others.

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 22nd Apr 2013 23:14
I reckon that the FBI or GCHQ would crack that in about 0.00000000001 seconds, and wouldn't care. What they care about is seriously heavy encryption on documents etc. If they can't, and you give them the algorithm, no worries. They'll just steal your algorithm.

You have a right in international law to protect your copyrighted assets.

The advantage of the technique I posted above is that it only smacks the header region, so it's fast to decode, even on quite slow devices.

I'll do an audio example just mangling the data and post it later.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Alain91
13
Years of Service
User Offline
Joined: 20th Aug 2011
Location: France
Posted: 23rd Apr 2013 08:52
Hello Jim,

I think a lot of people are interested in a tool like your.

By the way it would be cool to have 'batch' options in order to encrypt a lot of files in one operation, and to encrypt not only bitmaps but any kind of files ?

Thanks a lot !
Alain
haliop
User Banned
Posted: 23rd Apr 2013 11:06
JIM. PLEASE PLEASE PLEASE build it! i dont have time to do it myself ... work and projects... but please if you do i will sure to buy it if its 100 percent hack proof.
will buy! you already have your first costumer.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Apr 2013 11:28
Quote: " There needs to be a CreateMemblockFromFile function that would load an entire file into memory without worrying about content. "

I somewhat created that before I updated to the latest beta to get the readByte command.
http://forum.thegamecreators.com/?m=forum_view&t=204967&b=41

I think the main problem at the moment in Tier1 is what do you do with the data once you've decrypted it. Without a way to make an image from a 'memblock', I don't know how you'd make use of it.


Quote: "it only smacks the header region"

Not on zip files, the header is at the end. At most, it would encrypt a single entry in the archive. But those already have encryption built in anyway.


Quote: "but please if you do i will sure to buy it if its 100 percent hack proof."

But it's not.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
haliop
User Banned
Posted: 23rd Apr 2013 11:38
well yeah i know 100 percent is not the right way to say it .. but all im asking for is that if i release an app of somekind so it will be extremlly hard for someone even someone who knows how to decrypt so he wont..

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Apr 2013 16:50 Edited at: 23rd Apr 2013 16:51
There is a CreateImageFromMemblock command.

But you have to have v108+ and be looking at its help (available on your local drive) to find it.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 23rd Apr 2013 19:49
It'd probably be best to "smack" the header at the beginning and also the end to make sure zip files are covered. Then again, you could just encrypt headers on the contents of the zip file...
I like this idea of only encrypting the header - provides complexity and speed.

Check out dFenz on Google Play, Windows, or Mac:
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 23rd Apr 2013 21:16
Nothing is 100% hack-proof. What counts is that it's impossible for a casual user and extremely hard for a professional.

In the first post I've added another technique for you to think about. This one is fun!

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Apr 2013 00:47
Ahh ok. I just updated to 108, havent gone through every single command yet. Be nice if there was a log that said which commands were added, but I haven't seen anything.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 24th Apr 2013 01:39
Phaelax - I think you posted in the wrong thread!

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Apr 2013 05:11 Edited at: 24th Apr 2013 22:48
Nope, I was replying to ancient lady.

"You're all wrong. You're all idiots." ~Fluffy Rabbit

Attachments

Login to view attachments
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Apr 2013 22:41 Edited at: 24th Apr 2013 22:49
Well, I thought I had a method for encrypting images, using a smaller image as the key. But it's not working and I'm not sure why.
I attached the image I'm using for the key. I feel as though it's something painfully obvious.






"You're all wrong. You're all idiots." ~Fluffy Rabbit

Attachments

Login to view attachments
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 24th Apr 2013 23:32
Looks to me like you're NOT using your "key" memblock (memKey) but in all cases the first one. You need to perform exactly the same operation to return it to the original.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Apr 2013 23:38
I think JimHawkins is correct.

I suspect this line: k = getMemblockInt(mem, keyPos)
should be: k = getMemblockInt(memKey, keyPos)

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Apr 2013 23:43
Ah yes that's it. See, I knew I was doing something "obviously" wrong. Stupid little typos!

Well, now you all have a method for making your images harder to steal.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 24th Apr 2013 23:50
Memblocks are limited to a image size of 128x128 or whas it 256x256.

I belive i encountered it when testing the new command.
Some type of memory usage limitation.

Have anyone tested phaelax code on an larger image?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th Apr 2013 00:33
The image I tested mine with was 256x928

"You're all wrong. You're all idiots." ~Fluffy Rabbit
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Apr 2013 00:35
The maximum size of a memblock is apparently 100,000,000 when you use the vanilla CreateMemblock. I assume that is in bytes.

But it doesn't discuss maximum image size for the CreateMemblockFromImage.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Apr 2013 01:20
It's a nice idea, but there is no advantage in XORing with another image and it may be slower than using a mask array or even a couple of values. The good thing you've done here is to expose a technique for working in a memblock!

If we had a similar thing for WAV files, it would be easy to protect audio assets in the same way.

For music (which is spooled) a technique like file appending which I showed in the top post will fool almost all people.

I hope you're finding this an interesting thread. Building these things into the AppGameKit core would immediately expose it to hackers, whereas rolling your own makes life much tougher for them, because every program will be different.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th Apr 2013 06:35
Quote: "but there is no advantage in XORing with another image"

Probably so, but it's an interesting way to use a key.

"You're all wrong. You're all idiots." ~Fluffy Rabbit

Login to post a reply

Server time is: 2024-11-24 12:05:11
Your offset time is: 2024-11-24 12:05:11