How i can do that? Protect my videos on my blog?

Discussion in 'Programming' started by luczian, Jul 9, 2010.

  1. #1
    Hi. I have an wordpress bolg and i have a lot of videos on it.

    Now i wanna protect this videos with some encripting plugins.

    I don't wanna to encoding, becouse it's easy to decript.

    I need some encripting plugins with custom password, to be impossible to view by users with page source.

    In browser in wanna that video look normaly.

    Eist plugin like this? Please help, if you know. Exist others ways to protect this? I wanna protect just posts , not header, footer or sidebar.
     
    luczian, Jul 9, 2010 IP
  2. Rainulf

    Rainulf Active Member

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #2
    I'm assuming that these videos are embedded. There is no way for you to completely protect your videos on your blog, the client-side will always see your HTML's source code. But you can make it harder for people to copy it with this:
    
    <script language="JavaScript"> 
    
    
    function encrypt(tx) { 
       var hex=''; 
       var i; 
       for (i=0; i<tx.length; i++) { 
          hex += '%'+hexfromdec(tx.charCodeAt(i)) 
       } 
       return hex; 
    } 
    
    function hexfromdec(num) { 
       if (num > 65535) { 
          return ("err!") 
        } 
        first = Math.round(num/4096 - .5); 
        temp1 = num - first * 4096; 
        second = Math.round(temp1/256 -.5); 
        temp2 = temp1 - second * 256; 
        third = Math.round(temp2/16 - .5); 
        fourth = temp2 - third * 16; 
        return (""+getletter(third)+getletter(fourth)); 
    } 
    function getletter(num) { 
       if (num < 10) { return num; } 
       else { 
          if (num == 10) { return "A" } 
          if (num == 11) { return "B" } 
          if (num == 12) { return "C" } 
          if (num == 13) { return "D" } 
          if (num == 14) { return "E" } 
          if (num == 15) { return "F" } 
       } 
    }
    
    
    document.write('encryped: '+encrypt("lol")); 
    document.write('<br />decoded: ' + unescape('%6C%6F%6C'));
    </script>
    
    Code (markup):
     
    Rainulf, Jul 9, 2010 IP
  3. luczian

    luczian Active Member

    Messages:
    266
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #3
    thank you for your solution. I have a blog with over 4000 posts, can do that automaticaly? Like an wordpress plugin. I'm very new on programing. i know a little html :)
     
    luczian, Jul 9, 2010 IP
  4. Rainulf

    Rainulf Active Member

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #4
    The code above is javascript, it shouldn't be hard to pass variables from javascript to PHP and vice versa.

    I can probably make some kind of converter. Not a wordpress plugin, but a PHP script. :) PM me the details if you're interested.
     
    Rainulf, Jul 9, 2010 IP