Jetpack on Facebook
JetpackHQ | Blog Home | Users | Register | Log in    

Protecting Flash Source Code

July 26th, 2009 - filed under Programming

Imagine spending months or years creating a game, only to have several remarkably similar games appear on the market at the same time.  If your source code is leaked or stolen, you could easily find yourself in the position of competing for income with your own work.  Languages like C++ are compiled into machine code, but a major downside of Actionscript is that your source code is maintained virtually intact in your released SWF.  While the few flash decompilers out there are admittedly very buggy, the opporunity exists for a dastardly thief to spend minimal effort to produce a game very similar to your own.  Legal options are often available, but its much easier to avoid the expense and hassle by protecting your code.  This is why SWF obfuscation tools exist.

I evaluated Kindisoft’s secureSWF, Amayeta’s SWF Encrypt, Ambiera’s irrFuscator, and LockLizard’s Lizard Flashguard.  Based on the level of security features, ease of use, and stability, the tool I’ve chosen for this task is secureSWF.  It offers several good features, and the ones I found most useful are:

  • renames identifiers
  • uses several techniques to obscure code flow
  • encrypts strings
  • optimizes code
  • has build process integration

Obfuscating Actionscript is a pretty complex task and secureSWF handles it well – my SWF ran perfectly with adjustments to all security settings.  Here are the results of my rough performance comparisons:

no security
plain SWF: 211k , 37fps

default settings
secure SWF: 293k, 35fps
40% larger, 6% slower

custom settings – disabled “control flow obfuscation”
secure SWF: 244k, 37fps
15% larger, no performance loss

Tweaking the settings for less aggressive encryption can give better size and performance, but I consider the small performance hit to be a mandatory cost of business for creating a mid-scale game using Actionscript.  If you have a lot of high quality original source code that you want protected, I highly recommend Kindisoft’s secureSWF.

3 Responses to “Protecting Flash Source Code”

  1. Travis Travis Says:

    Cool! Glad to know that your making more progress and that encryption now works!

  2. Daniel Downes Daniel Downes Says:

    Thanks for this, I’m currently making a 3D Flash game and will be considering obfuscation before its alpha releases.

    Very useful to know, I’ll check out Kindisoft now..

  3. sting sting Says:

    That sounds like a challenge to me.

Leave a Reply

You must be logged in to post a comment. Register here.


  • Categories