How to hide css code
‘Rippers’ are always trying to steal your design or style? I think this will help you.
In index.php write:
-
session_start();
-
$_SESSION['csskey'] = "somerandomstringoftext";
-
?>
-
<html>
-
<head>
-
<link rel="stylesheet" type="text/css" href="style.php" />
-
</head>
-
<body>
-
Hello World
-
</body>
-
</html>
Then, create new file called style.php
Write in it:
-
session_start();
-
header("Content-type: text/css"); //this will tell apatche to read file as a css format
-
-
if ($_SESSION["csskey"] != "somerandomstringoftext") {
-
die("Protected");
-
}
-
$_SESSION["csskey"] = "More RandomStrIngs".rand(1,20000);
-
?>
-
-
/*
-
CSS HERE
-
*/
Tutorial by litewarez
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.
![[Google]]( http://www.warezteacher.com/wp-content/plugins/easy-adsenser/google-light.gif)

June 15th, 2009 at 12:20 PM
Nice idea, more of a pain to leachers than anything. If you wanted it more secure you could also use mysql to make each key unique. But anyway nice idea.
A simple improvement could be made like this if you wanted:
$_SESSION["csskey"] = md5($_SESSION["csskey"].”More RandomStrIngs”.rand(1,20000));
Would make it practically impossible to breake the key atleast, but not making it impossible to leache the style still
Splitice
http://thewarezscene.org
June 15th, 2009 at 4:31 PM
yea but think about it now splitice lol.
MD5 has a constant string length and combining the fact that they would need the source of the file to view the unencrypted string it would not make a difference md5 or not because the md5 hash changes practically every time due to the rand(1,1000);
but there is one flaw with this and that’s the fact the they can use a debugger to view the source of the css as its cached from the apatche buffer then brought to the clients pc and the debugger reads that.
but none the less it will stop 100% of users that are not familiar with these tools.
June 18th, 2009 at 11:31 AM
Hey, great post, very well written. You should write more about this.
June 20th, 2009 at 3:40 PM
Thankyou dood i will be writing as much as possible so stay tuned to the WarezTeacher for updates and more tutorials…
P.S.
Push that lil bookmark button please