Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3332558
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:42:03+00:00 2026-05-17T23:42:03+00:00

i’m using AMFPHP to stream content from my server to my Flex application, since

  • 0

i’m using AMFPHP to stream content from my server to my Flex application, since Flash is a clientside technology i would like to make it harder for people to grab protected files, so i created a system that streams swf file to another flash player, i’ve done all the testing on URL stream, now i want to pass the swf file to the player as bytearray .. since i think it’s safer and harder to break and in the future i even might do some encryption of my own if i became more familiar with bytes and bits .. anyways is my method the best one? (SWF to ByteArray?) or is there a better one? if the bytearray method is the best, i am facing a problem in outputing the swf file in the right format, i’m using a very primitive method ..

        $file = file_get_contents($file); 
        $byteArr = str_split($file); 
        $byteArr = array_map('ord', $byteArr);
        $return['fileBin']->data = $byteArr;

and i return the $return variable …

your help is highly respected and appreciated.

Rami

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:42:04+00:00Added an answer on May 17, 2026 at 11:42 pm

    Hm…

    I use something very similar currently (I’m developing an MMORPG…) – I decided I needed the content of the game preloaded so the player doesn’t have to wait so much. Unfortunately – These files would be easy to just browse and even decompile.

    Because of that I made a custom compression+encryption combo that needs a password. This password is sent by the server when needed.

    However, in your case this is not the best thing to do. ByteArray is not anything hard to break – essentially it will send raw byte data. Unless of course you encrypt it (+1).

    Another good thing to do would be to tokenize the requests (+1). I.e. in PHP you generate a “token” and write it to a token-list file. The token would be something like 32 alpha-numerals. This token would also be passed to the SWF object / page requested, which would immediately use it in request. The request works ONLY with a valid token, that is, one that was recorded in the token-list. When it is used, it is removed instantly. Also, there could be a time limit on each token. Like 15 or 20 seconds. If it is not used by then, remove it. User-side (if loading too long) would need to be reloaded (although not manually – can be some script, or iFrame to reload just the SWF) if time limit was exceeded.

    EDIT : the author of the question asked differently – his aim is apparently to make the SWF file requested reachable / loadable ONLY by the loader application. Nothing else. So:

    I’m afraid this is a hard thing but… It’s not really possible to make something impossible to crack / hack into. Fortunately it is easier to do in networks (although they are attacked more often) or internet. You CAN’T make something that can be loaded only by your application. If you think about it – it is impossible even logically – in both cases (user-requested AND application-requested), the user computer requests one file, and it is easy to track that request and replicate it or to simply intercept it. Decompilation of SWFs would be used if any of the former two doesn’t work. A little bit about countering all possibilities:

    A) track and replicate

    This is easily doable with such tools as Firebug on FF, or equally good (really) Inspector on Safari. With these, it is easy to see what was requested, the headers and response (luckily it is not possible to download the file requested – it is not recorded as long as it is not html or plain text MIME), also the response headers.

    There is no use in obfuscating the request URL in code, if it will ultimately be shown as requested in the console of one of these tools. Solutions would be:

    1. make the request one-time only (shown above – tokenization)
    2. use a special header for the request, such as “Connection: keep-alive” – this makes it quite harder for normal attackers, because they will often just copy the URL and request it in browser – but the connection there will be automatically “Connection: close”, check for that in server-side code and accept only the keep-alive (or your “special”) requests
    3. use a protocol different from HTTP – unfortunately this involves server-side socket functions for communicating on different ports than HTTP’s 80… most server providers don’t let users do this, but if you can – and want security – do it – don’t use any known protocol, but rather something that suits just your need – after all, you control both server-side and client-side, so the communication can be done anyhow

    B) interception

    It is a little bit higher-level attack – but if the attacker is skilled and has SOME resources, not so hard to do. Essentially this comes to having a proxy of kind (hence the resources – need for a server with sockets enabled, which I myself have :D), that he will use to connect through with his browser. The proxy will, however not only forward content, but at the same time record it. Countering:

    1. use different protocol
    2. encryption of that protocol – because even if the data is recorded, it doesn’t matter – it is no longer just HTTP headers followed by raw file data (the headers are easily removed and “violá”) – only the client-side application knows how to use this data

    C) decompilation

    This isn’t even so hard to do – SWF decompilers are not anything new now, and any code from your application is freely available to the attacker. Even if you use different protocol, the attacker can, with less or more effort, break into it. Solutions:

    NONE – you can just make it harder for the attacker – obfuscate your code, have a lot of it (if you really WANT the security… chaos might just be your friend), use cross-client cross-server requests for the actual code – dynamically loaded secondary SWFs that load the code…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
In order to apply a triggered animation to all ToolTip s in my app,
I want use html5's new tag to play a wav file (currently only supported
I want to count how many characters a certain string has in PHP, but
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.