Flash Kid Logo  
Home - Tutorials - Applications - Games - Books - Directory - Community - Site Map - Contact Us  
 
 


 

SWF Security and Flash Encryption
Author: Alexandre Chevalier
Difficulty Level: Advanced
Flash Version: ActionScript 3
Prerequisites: ActionScript Basics, SWF FIle Basics

Introduction:

To protect your ActionScript code within your SWF you must make your SWF secure. SWF Protector from DComSoft serves exactly this purpose and it will protect swf files from industry leading flash decompilers e.g. SWF Sothink Decompiler.

In this tutorial I will guide you through installation and how to increase swf security and flash encrypt your project using SWF Protector.

 
 
  • Download an installation package from DComSoft site,  depending on platform type you use (Windows, Mac OS or Linux);
  • Install it using the installation guide available with each package;
  • Launch SWF Protector;
  • Choose from two tabs/modes: Simple mode  or Advanced mode tab


SIMPLE MODE
In Simple Mode SWF Protector chooses protection methods by default for both standard and user code according to Action Script version.

In case a SWF file contains ActionScript version 2.0 then Mask script and Mix script are applied.

Mask script is an effective method of concealing the code, which doesn't cause the increasing of the SWF file size.

Mix script is shaking the source code of your SWF. The method is very effective, although it causes the increasing of the file size. That is why SWF Protector lets you choose the intensity of method applicability. In Simple Mode for files with AS2 Mix script is applied in 50 % mode by default.

In case your SWF file contains ActionScript version 3.0 then Protect and Obfuscate methods are applied.

Protect method modifies AS in such a way that a SWF file may be loaded by Flash player, but it is impossible to decompile it.

Obfuscate method renames variables, features etc. in a strictly definite way. Although it doesn't prevent from decompilation, but makes the subsequent compilation impossible.

Protect SWF files at once
Fig. 1 - Protect swf files at once

ADVANCED MODE
Like in Simple Mode, in Advanced Mode the choice of method depends on AS version the SWF file contains and the same protection methods are used. The difference is that Advanced Mode permits to manage settings for all the code blocks of the file, standard and user. The code is displayed hierarchically and you can choose the code block and which protection method to apply to it.

Mix script and Mask script are applied if a SWF file contains AS2.

SWF Protector Configurations and Settings
Fig. 2 - SWF Protector Configurations and Settings

When you apply Mix script you may choose to use the method by default (50%) or to choose its intensity using the slider. The lesser the intensity, the lesser the file size, the less reliable protection.

Note 1: If you set Mix script to minimum, then this protection method won't work.

Note 2: Applying Mix script and Mask script you may turn off all standard code to decrease the file size. In this case, the protection will be less reliable.

Protect and Obfuscate methods are applied if a SWF file contains AS3.

Protect and Obfuscate flash
Fig. 3 - Protect and Obfuscate flash

Note: If a SWF file doesn’t contain AS, "Protect" button will be inactive.

Note: You may turn off all standard code to decrease the file size. In this case, the protection will be less reliable.

  • Once the settings will be adjusted press "Protect" button.
  • After the protection process is finished, you will get two SWF files: original and the protected one.
 
 
 
 
 
 
 
Related Links
Discussion Forums for Tutorials
 
 
 
Feedbacks :
 
Jul 12, 2010 - Ross : Interesting tutorial. Thanks.
 
 
Send Feedback
Your Name:
Email:
Comments:
 
Code:
 


 
 
 
 
 
© 2010 flashkid.org! All Rights Reserved.
 
   
 
a project of: salmanawan, other projects: xonsolutions.com