Pls. suggest how can we protect ur flash work from swf catchers.

thnx,

Dani AI

Generated

Short answer: you cannot make an SWF impossible to copy. As said, anything the client can run can be captured; ’s point (“don’t put it online”) is blunt but technically true. The best approach is to raise the effort required so only a determined attacker succeeds.

Practical, layered defenses (combine several)

  • Use server-side delivery: serve SWFs/assets through a proxy that requires a signed, short-lived token or an authenticated session. This prevents simple link-copying and hotlinking.
  • Keep critical logic or assets on the server (APIs) rather than buried in the client SWF.
  • Obfuscate/encrypt ActionScript to slow decompilers; treat this as deterrence, not prevention. Free decompilers exist (see JPEXS) so consider obfuscation only a hurdle.
  • Domain/player checks (as suggested by ) help against casual copy-paste but are bypassable (local playback, patched SWFs, referer spoofing).
  • For media, use streaming plus DRM (Widevine/PlayReady/FairPlay) instead of static SWFs, and add visible/forensic watermarks for ownership tracking.
  • Legal notices and licensing don’t stop copying but help enforcement.

Example: signed URL pattern (conceptual)

# generate a URL with expiry and HMAC signature
$expires = time() + 300;
$payload = "/swf/myfile.swf|$expires";
$sig = hash_hmac('sha256', $payload, $secret);
$url = "/get.php?f=myfile.swf&exp=$expires&sig=$sig";

On the server validate the signature and expiration before streaming the file.

Notes and caveats: SWF encryption and obfuscation raise the bar but cannot stop a motivated reverse-engineer (see https://github.com/jindrapetrik/jpexs-decompiler). Flash is end-of-life and unsupported in modern browsers; migrate interactive work to HTML5/Canvas/WebGL where asset delivery and modern DRM/streaming options are easier to control. ’s suggestion to try encryption tools is valid — use them as one part of the layered approach.

Recommended Answers

All 5 Replies

you cant, they need to able to download it to watch it

If you want to protect it, don't put it on the Internet.

I predict the end of the concept of "intellectual property" within a few years.

Member Avatar for Member #114696

If you mean that you dont want others to download and watch your swf files, then yes, you could save it, indirectly though. Basically they will download it, but wont be able to watch it. Firstly you could check whether the domain in which the swf movie is running is allowed using object. This is probably used extensively by Flash game sites. Here's how you could implement it.

var loc:LocalConnection = new LocalConnection();
var domain:String = loc.domain();

if (domain == "www.yoursite.com") {
    gotoAndPlay("start");
} else {
    gotoAndPlay("access_denied");
}

And you could check in which player are you running this swf file using
For Example:

var player:String = System.capabilities.playerType;
if( player == "ActiveX" )  
    gotoAndPlay("start");
else
    gotoAndPlay("access_denied");

And to prevent your swf from being decompiled, use any SWF Encrypters. However, as far as I know it would only encrypt your ActionScript, your sound and movies will still be readable.

thanks a lot for your great solution.

thnx,

There are several swf encryption programs.

Google swf encryption

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.