Web Developer Tutorial: How to Protect SWF files From a Decompiler

By Community Member FlashKit

Flash SWF files contain your important Intellectual Property, but once they are on the web, anyone can download your SWF file and decompile it with a Flash decompiler tool. This tutorial will show you how to protect your SWF files from decompilers using SWFProtection.

What You Need

SWFProtection: The software comes with a free trial, so you can check it out before you buy it. You may download the trial version here.

SWFProtection stops all Flash decompilers, thus helps you protect your valuable design and intellectual properties from being stolen. The program uses a new feature of Flash 9 and Actionscript 3. It converts your SWF file to binary data, then encrypts the data and embeds it into a new SWF file. In this way, all content in the SWF file, including Actionscripts, images, sounds and animations, will be protected. The program enhances the encryption further with Actionscript obfuscation.

The built-in domain locking feature can disable viewing of the SWF file from local computers and only allow SWF files being hosted on specified domains to be viewed, so the SWF file will only work on your own website. If they are downloaded, they will refuse to play and display a warning message or just render as useless.

Step 1 in the Protection Process

Download and install SWFProtection. Launch the software, click the button "Add File", browse the SWF files which need protection and add them to the file list.

Step 2

Click the "Domain Lock" tab, check the options "Disable viewing SWF files from local hard disk" and "Only allow SWF files hosted on domains", then click button "Add", and enter your website's domain name. If you want to display a warning message when someone tries to view your SWF file on a local computer or when they upload it to their website, you can check the option "When domain is incorrect" -> "Display message", then enter the HTML formatted text in the input box. Hyperlinks are supported in the warning text.

Step 3

Click the "Output" tab, define how to rename and where to save the protected SWF files.

Step 4

Click the button "Protect". Congratulations! You have successfully protected the SWF files. In a typical Flash decompiler, the protected SWF file will look as shown below.

The following Flash SWF file is protected with SWFProtection--you may download and test it out yourself (right mouse click on the link, choose Save As).

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
Thanks for your registration, follow us on our social networks to keep up-to-date