how can I hide a .css code?

Status
Not open for further replies.

Tigger

Active Member
123
2009
0
0
I guess we have to just accept the fact that there is NO way to hide your web codes from been taken, however there may be some ways to make it as hard as possible...

Now for my case I want to hide/protect an .css text file, by hiding I mean to make it as hard as possible from someone to see the actual code... my roommate mentioned why don't you just make the text color 'white' on a 'white' background so no one can see it when they type the exact url of the .css file :))

Well if there is no better way I guess I may think of his idea ... <_<

Thanks.
 
18 comments
There isn't really a way to do it.
It's front-end code so it'll always be visible so the browser can interpret it.
 
yes you can. try encrpyting your html before uploading it. there are numerous encryption software available, but you can try Encrypt HTML Pro.
but even then it mite be possible to view the html (eg. Adobe GoLive), but atleast you can stop the less experienced ones stealing your codes.
 
you can external link your css, then name the file something really weird. might confuse em, but like JmZ said, theres no real way of not being able to show it..
all the user has to search for in your source is .css
meh
 
yes you can. try encrpyting your html before uploading it. there are numerous encryption software available, but you can try Encrypt HTML Pro.
but even then it mite be possible to view the html (eg. Adobe GoLive), but atleast you can stop the less experienced ones stealing your codes.

Actually, you can't.
The only way would be to have javascript decode a string which it then places in a CSS/style tag. And even then, it's not encrypted, it is encoded (meaning anyone can decode it within seconds). You could even just run the script in your browser which it uses to decode and you'd have it instantly.
 
Actually, you can't.
The only way would be to have javascript decode a string which it then places in a CSS/style tag. And even then, it's not encrypted, it is encoded (meaning anyone can decode it within seconds). You could even just run the script in your browser which it uses to decode and you'd have it instantly.

Yeh you could base24 encode it thats about all you can do even then it wont stop your average ripper but it will stop the noobs.
 
Yeh you could base24 encode it thats about all you can do even then it wont stop your average ripper but it will stop the noobs.

So if anyone really wanted the CSS, they'd just base64 decode it. Which is what my point is. He's wanting to stop people from taking his CSS, which means the only people who would ever want his CSS will know how to decode b64.
 
So if anyone really wanted the CSS, they'd just base64 decode it. Which is what my point is. He's wanting to stop people from taking his CSS, which means the only people who would ever want his CSS will know how to decode b64.
Didnt say you cant decode it i just said it would stop the noobs.
 
Yeah but what i mean is he doesn't want to stop newbs, he wants to stop people with knowledge on such things. Meaning they'd get the code anyway.
 
Well to be honest as JmZ as said, you can encrypt it, BUT that will only stop noobs, and to be honest with you, why would someone who knows how to work and code css actually need to steal yours?

Do you mean noobs or experts?

If noobs, just ask JmZ, he knows his stuff ;)

If you mean the experts, I am pretty sure they will just code their own :)
 
theres ways in php of making it more difficult to get for instance

index.php
PHP:
<?php
session_start();
$_SESSION['csskey'] = "somerandomstringoftext";
?>
Code:
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="style.php" />
    </head>
    <body>
        Hello World
    </body>
</html>
create a php called style.php

then inside
PHP:
<?php
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
*/

basically this should make it a little harder for them !
 
wow thank you litewarez! if i end up doing my own custom style, i will be sure using this method to prevent rips! Maybe NinjaWarez admins should like at this thread?
 
It may stop people accessing the css directly but people may still view it using a debugger of some kind.
 
yep JmZ is right and thats why i said it will only make it harder for them, noobish ppl wont think of using a debugger but if they knew what they were doing like me n jmz and we wanted the css we could do it lol
 
Status
Not open for further replies.
Back
Top