views:

203

answers:

5

I'm working on important project using Flex framework and i want to keep my algorithms and code secret. Is it possible to somehow protect swf file from being decompiled? I don't want someone extract my code using flash decompilers.

Thanks.

A: 

you can protect them by setting a password while compiling. can this solve your security issue?

daniel
Decompilers can avoid this easily. They only prompt a warning when encountering a pwd protected swf.
Michael Bavin
how do u do that?
Amarghosh
I tried this in the past. (with my own files). How? open a decompiler, import swf, click decrypt, click OK on warning.. :)
Michael Bavin
Ok, i found the tool i need http://www.amayeta.com/software/swfencrypt/Thanks.
Borivojević
+1  A: 

While there is no full-proof way to secure code from decompilers there are some tricks to reduce the chances of this happening.

  1. host the .swf on a https server then it doesnt get cached
  2. You can obfuscate the code to make it impossible to understand even if it is decompiled.
  3. Change the file extension of the .swf file to something like a .jpg file or a .png file, the browser should still detect that it is a .swf and display it correctly, but it will be stored in the cache as an image file
Todd Moses
A: 

There is a product that encrypts the code inside the swf. It's not bullet proof but does protect.

Michael Bavin
+3  A: 

It's simple. Just keep it on your PC and don't put it on the web.
ALL can be decompiled, reverse engineered and hacked, even programs written in c++/c/asm. If you want to make this task of decompiling a bit harder use some obfuscators for flash

zihotki
A: 

There are many tools to "encrypt" SWF even though I don't think we can actually discuss encryption here. Encryption is not obfuscation.

I've reviewed one such obfuscation tool just recently, see Protect your ActionScript code with SWF Protector.

Although it does pretty well for an obfuscator, you need to realise that:

  • obfuscation increases file size;
  • most obfuscation algorithms in use today are still pretty easy to reverse engineer, so it's certainly not a bullet-proof solution. It's just obfuscation and is likely to keep off amateurs and pros who find it easier to rewrite from scratch rather than mess with reversing the obfuscation.
Ain