Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Javscript Obfuscation question

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
lilwoof
Smarty n00b


Joined: 03 Dec 2012
Posts: 3

PostPosted: Fri Jun 07, 2013 10:38 pm    Post subject: Javscript Obfuscation question Reply with quote

So, in a template I'm using something like this:

Code:
{literal}
<script>
jwplayer("player").setup({
  file: "http://www.mydomain.com/content/scrf-002/preview/scrf-002p_480p.mp4",
  'image': "http://115368350.r.cdn77.net/content/contentthumbs/36119.jpg",
  height: 535,
  width: 920,
  autostart: false
});
</script>
{/literal}


What I'm wanting to do is have SMARTY take that (with a capture) and hex it out as:
Code:

var _0x927e=["\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x6D\x79\x64\x6F\x6D\x61\x69\x6E\x2E\x63\x6F\x6D\x2F\x63\x6F\x6E\x74\x65\x6E\x74\x2F\x73\x63\x72\x66\x2D\x30\x30\x32\x2F\x70\x72\x65\x76\x69\x65\x77\x2F\x73\x63\x72\x66\x2D\x30\x30\x32\x70\x5F\x34\x38\x30\x70\x2E\x6D\x70\x34","\x68\x74\x74\x70\x3A\x2F\x2F\x31\x31\x35\x33\x36\x38\x33\x35\x30\x2E\x72\x2E\x63\x64\x6E\x37\x37\x2E\x6E\x65\x74\x2F\x63\x6F\x6E\x74\x65\x6E\x74\x2F\x63\x6F\x6E\x74\x65\x6E\x74\x74\x68\x75\x6D\x62\x73\x2F\x33\x36\x31\x31\x39\x2E\x6A\x70\x67","\x73\x65\x74\x75\x70","\x70\x6C\x61\x79\x65\x72"];jwplayer(_0x927e[3])[_0x927e[2]]({file:_0x927e[0],"\x69\x6D\x61\x67\x65":_0x927e[1],height:535,width:920,autostart:false});

I know it's not the BEST way to protect data or scripts, but it's better than nothing and would deter someone like my mom. Sure, smarter people would realize what is happening and get around it. I'm not arguing that. I just want to make it slightly more difficult.

I'm hoping there is a way to do it with smarty.[/code]
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP