How to Encrypt the Flv source Only

Discussion in 'PHP' started by romeo2010, Mar 10, 2008.

  1. #1
    How to Encrypt the Flv source Only

    i've seen some site encrype teh source of the flv file .. how can we do that

    such as the following example...its not real buts its like that

    i think it could be done through php as well as javascript
     
    romeo2010, Mar 10, 2008 IP
  2. romeo2010

    romeo2010 Peon

    Messages:
    183
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    ok so i got the first part based on researchh.. i need help for the second part to make it work


    here is the code that encrypt the flv source

    <?php
    
    $filename = "http://www".$_GET[f].".myvideo.com/files/".$_GET[video].".flv";
    
    $video = encrypt_decrypt($filename);
     
    function encrypt_decrypt($string)
    {
    // encrypt/decrypt a string message v.1.0 without a known key
    // author: Aitor Solozabal Merino email: aitor-3@euskalnet.net
    $length = strlen($string);
    $encrypted_string = "";
    
    for($position = 0; $position < $length; $position++)
    {
    $encrypted_string .= chr((ord(substr($string, $position, 1))) ^ ((255 + (($length + $position) + 3)) % 255));
    }
    return $encrypted_string;
    }
    
    ?>
    Code (markup):
    then i put this in the player

    <
    object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="604" height="441" id="flvplayer" align="middle">
    <param name="allowScriptAccess" value="always" />
    <param name="movie" value="flvplayer.swf?flv=[COLOR="Red"]<?php echo $video;?> [/COLOR]"&autoStart=true&clicktext=buffering" />
    <param name="allowFullScreen" value="true" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#000000" />
    <embed src="flvplayer.swf" 
    
    
    flashvars="flv=[COLOR="Red"]<?php echo $video;?> [/COLOR]" 
     quality="high" bgcolor="#000000" width="604" height="441" name="flvplayer" align="middle" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    Code (markup):



    SO now when i pass variable through address bar
    example mytv.com/play.php?f=22&video=465463123165465


    the player gets the info and its encrypted.....

    the problem is the player doesn't play.....

    thats mena i need another file "Stream.php"

    this file will be used for dycripting internally for the player to play

    Can someone help with that..


    i took some code from here

    Source links
     
    romeo2010, Mar 10, 2008 IP