...

View Full Version : using php for a secure xml playlist



tribalmaniac
02-05-2007, 08:49 PM
I'm using php to create xml playlists, but the problem is, I don't want people just to decompile the flash file, find the xml file's url - which contains the mp3 urls - and then they can download them for free.

Whats the easiest method to stop this happening?

chump2877
02-05-2007, 09:27 PM
I think you;re assuming that someone in the PHP forum would know how to "decompile a flash file"...So how does that work exactly? If I knew, maybe I could help you better...

tribalmaniac
02-05-2007, 09:37 PM
oops, sorry! Basically, there are programs that can get the raw code from a flash file called flash decompilers. and if someone ran one of these on the player theyd obviously find a link to the xml file.

Thanks
Matt

chump2877
02-05-2007, 09:54 PM
So how are you thinking that PHP can help you prevent someone from using presumably client side code to extract an XML file name? If the XML file name is embedded in the Flash file? and the Flash file was created in MAcromedia Flash, how does PHP come into play? Are you using PHP inside of Flash -- using PHP with or inside your ActionScript?

By the way, I have no clue how to get PHP code to work inside of Flash, just trying to clarify the problem...;)

Also, can you show me some code, because that would probably help...

tribalmaniac
02-05-2007, 10:30 PM
I dont' have any code at the moment :)

My issue is I don't want people to be able to be able to download the mp3s

Im makign the xml files with php, using mimetypes and dragging info from the database.

I know I could use a streaming server of some sort to make the mp3s not downloadable, but i was wondering whether there was an easier way or a way of encrypting the xml or something?

Matt

chump2877
02-05-2007, 11:55 PM
I think you answered your own question?...why don;t you encrypt the mp3 URLs inside your XML file...you don't have to encrypt the whole file...

But I'm fuzzy on how your Flash player is interacting with the XML file (like how is the playlist read by the Flash player?)...not my area of expertise I guess...If you encrypt your mp3 URLs, does that cause problems with the Flash player? Would you be able to decode the URLs to access and play the mp3 files (with Flash)? Or would you have to decode the XML with a client side script, instead of PHP? Would this decryption code be embedded inside Flash?

Encryption might be an option if I understood how your Flash player could possibly decode the encrypted data...

Maybe this question belongs in the Graphics and Multimedia forum?

tribalmaniac
02-06-2007, 09:57 AM
The XML file is being read like this:

http://www.theflashplace.com/tutorials/Handling_XML:_VERY_useful

The reason i posted this here is because the server side scripting im using is php. I guess a simpler question would be is there an easy way to make XML files not accessible or readable using PHP?

firepages
02-06-2007, 04:22 PM
Your question is more about hotlinking than anything, google on how to prevent hotlinking to your mp3 file or directory. Or as an alternative serve XML files only to a given host or ip (localhost)

chump2877
02-06-2007, 07:19 PM
The XML file is being read like this:

http://www.theflashplace.com/tutorials/Handling_XML:_VERY_useful

The reason i posted this here is because the server side scripting im using is php. I guess a simpler question would be is there an easy way to make XML files not accessible or readable using PHP?

It looks like you are embedding Javascript inside of the Flash file, and the JS inside the Flash file is opening the XML playlist.

So theoritically, you should be able to encrypt the mp3 URLs with PHP (using some algorithm) and then decrypt the URL's in your javascript, after you have opened the XML file, using the same algorithm...

Have fun figuring out how to do that (and choosing a method of encryption/decryption) :), but it certainly seems doable...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum