View Source Protection

M

Mike

I have designed a web page that I love, but I want to protect my codes from
someone simply hitting view source... is there a code I can use

Thank you

Mike
 
H

Hywel Jenkins

I have designed a web page that I love, but I want to protect my codes from
someone simply hitting view source... is there a code I can use

Surely ye are trolling?
 
J

Jemdam.com

There is a very slick way of doing this. I found a script on the internet
called csource.php

If you have PHP on your server it will use a javascript function to scrable
your entire page. It works on all browsers but I did find that macs are VERY
slow and decoding it back. Maybe you would be best just scrabling sections
of your code.

Do a google search for 'csource.php php encryption' and you will find plenty
of examples.

Cheers,

David http://www.jemdam.com > free webmaster tools
 
M

Marc

Jemdam.com said:
If you have PHP on your server it will use a javascript function to scrable

Why do you have to have PHP on your server to enable use of a JavaScript
function?

Marc
 
T

the idiot

Mike said:
I have designed a web page that I love, but I want to protect my codes from
someone simply hitting view source... is there a code I can use

Thank you
you should be pleased if someone thinks it is good enough to nick.
 
H

Hywel Jenkins

There is a very slick way of doing this.

I doubt it.

I found a script on the internet
called csource.php

Oooh. I find interesting, useful stuff on the internet. Amongst all
the crap of which you speak, there is some stuff that's worth using.

If you have PHP on your server it will use a javascript function to scrable
your entire page. It works on all browsers but I did find that macs are VERY
slow and decoding it back. Maybe you would be best just scrabling sections
of your code.

Do a google search for 'csource.php php encryption' and you will find plenty
of examples.

I did, and found none, apart from PHP error pages.


It doesn't work. It requires JavaScript on the client to do the
decoding, so it's a trivial task to output the decoded JavaScript, as
unrendered source code, to the browser. Select, copy, paste. Easy.
 
H

Hywel Jenkins

Why do you have to have PHP on your server to enable use of a JavaScript
function?

I suspect the PHP parses plain HTML, screws it up, then chucks it out to
the browsers "encrypted" (LOL!) and wrapped in a JS function that the
browser uses to "decrypt" the code in real time. Whatever it does, it
will be crap.
 
D

Dylan Parry

Using a pointed stick and pebbles, Jemdam.com scraped:
a javascript function to scrable your entire page.
^^^^^^^
Doesn't that break the rules set by the Monopoly Commission? ;)
 
R

rf

the said:
you should be pleased if someone thinks it is good enough to nick.

Related:

The value of the source code is in inverse proportion to the authors desire
to hide it.

Cheers
Richard.
 
N

Neredbojias

With neither quill nor qualm, Mike quothed:
I have designed a web page that I love, but I want to protect my codes from
someone simply hitting view source... is there a code I can use

Why? Are you selfish?
 
N

Neredbojias

With neither quill nor qualm, Greg N. quothed:
maybe he borrowed the code from some place else and now he's afraid
he'll get caught?

Hmm, this may be even more sinister than I thought. The solution, of
course, is to make the page, do a screen-capture, then publish one big
jpeg with minimal code on the Net itself. Totally untraceable.
 
M

Mark Parnell

Do a google search for 'csource.php php encryption' and you will find plenty
of examples.

No, I just found plenty of forums where people had problems with it.
Come on, post a URL. Someone here will break it in about 30 seconds at
most.
 
M

Marc

Neredbojias said:
Hmm, this may be even more sinister than I thought. The solution, of
course, is to make the page, do a screen-capture, then publish one big
jpeg with minimal code on the Net itself. Totally untraceable.

*shakes his head*

You mean one big bitmap image - a bmp has far more security than a jpeg
image! Everyone knows that. ;)

Marc
 
S

Stuart

Marc said:
*shakes his head*

You mean one big bitmap image - a bmp has far more security than a jpeg
image! Everyone knows that. ;)

Marc

LOL :)

Don't forget to make it larger than you actually need, too - you can
always scale it down to fit your need!
 
J

Jemdam.com

Okay, here is the PHP code to encrypt the page, just run it as an include in
your page and it will alter your page on the fly. It does have uses contray
to some of the negative people in this thread. I made a spam proof email
link with it. Have a look at:

http://spam.jemdam.com

Cheers,

David

<?
// Page HTML-source encrypter
//
// Usage notes:
//
// just put include('csource.php') in the beginning
// of your script. The HTML content will be automatically
// encrypted via Base64 algorithm so nobody can view it.

function _fwk_filter_encrypt($content)
{
$table =
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_@";
$xor = 165;

// Prepare encoding table
$table = array_keys(count_chars($table, 1));
$i_min = min($table);
$i_max = max($table);
for ($c = count($table); $c > 0; $r = mt_rand(0, $c--))
array_splice($table, $r, $c - $r, array_reverse(array_slice($table, $r,
$c - $r)));

// Encode sequence
$len = strlen($content);
$word = $shift = 0;
for ($i = 0; $i < $len; $i++)
{
$ch = $xor ^ ord($content[$i]);
$word |= ($ch << $shift);
$shift = ($shift + 2) % 6;
$enc .= chr($table[$word & 0x3F]);
$word >>= 6;
if (!$shift)
{
$enc .= chr($table[$word]);
$word >>= 6;
}
}
if ($shift)
$enc .= chr($table[$word]);

// Decode sequence
$tbl = array_fill($i_min, $i_max - $i_min + 1, 0);
while (list($k,$v) = each($table))
$tbl[$v] = $k;
$tbl = implode(",", $tbl);

$fi = ",p=0,s=0,w=0,t=Array({$tbl})";
$f = "w|=(t[x.charCodeAt(p++)-{$i_min}])<<s;";
$f .= "if(s){r+=String.fromCharCode({$xor}^w&255);w>>=8;s-=2}else{s=6}";

// Generate page
$r = "<script language=JavaScript>";
$r.= "function decrypt_p(x){";
$r.= "var l=x.length,b=1024,i,j,r{$fi};";
$r.=
"for(j=Math.ceil(l/b);j>0;j--){r='';for(i=Math.min(l,b);i>0;i--,l--){{$f}}document.write(r)}";
$r.= "}decrypt_p(\"{$enc}\")";
$r.= "</script>";
return $r;
}
ob_start("_fwk_filter_encrypt");

?>
 
J

Jonathan N. Little

Jemdam.com said:
Okay, here is the PHP code to encrypt the page, just run it as an include in
your page and it will alter your page on the fly. It does have uses contray
to some of the negative people in this thread. I made a spam proof email
link with it. Have a look at:

http://spam.jemdam.com

Cheers,

David

<?
// Page HTML-source encrypter
//
// Usage notes:
//
// just put include('csource.php') in the beginning
// of your script. The HTML content will be automatically
// encrypted via Base64 algorithm so nobody can view it.
<snip>

And are use using such encryption on that page link above?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,268
Latest member
AshliMacin

Latest Threads

Top