Jump to content

Best way to prevent "view source code"


condoravenue

Recommended Posts

Hello, I would like prevent people from viewing my source code. I want to show my clients their website before they purchase it, but I don't want them to be able to steal when I show it to them.

 

I searched on the internet and found several sites that use javascript to "encrypt" the code like this:

 

<script language='javascript'>
document.write(unescape('%3C%69%6D%67%20%73%72%63%20%3D%20%22%69%6D%61%67%65%73%2F%69%6C%6C%75%73%74%72%61%74%69%6F%6E%2E%6A%70%67%22%20%61%6C%74%20%3D%20%22%22%20%73%74%79%6C%65%20%3D%20%22%20%68%65%69%67%68%74%3A%20%32%37%32%70%78%3B%20%66%6C%6F%61%74%3A%20%72%69%67%68%74%3B%20%77%69%64%74%68%3A%20%33%30%35%'));
</Script>

 

But can't someone just reverse the unescape function and get the code? If they can't do that, they could still use the code above and it would work.

 

Is there a better way to hide source files?

Link to comment
https://forums.phpfreaks.com/topic/246761-best-way-to-prevent-view-source-code/
Share on other sites

But can't someone just reverse the unescape function and get the code?

 

'fraid so. There's no way for you to prevent them getting the source code, because at the end of the day the browser needs it to display the web page. If the browser has it, the user has it. You can obfuscate it, but not prevent them getting it. Of course, if someone's paying for you to develop them a website you would assume they can't do it themselves and wouldn't have a clue how to "decrypt" the encoded string.

 

I'm also guessing you don't complete an entire website for them before they even agree to purchase it, so a design complete but "lorem ipsum" filled type site would probably put them off trying to rip it anyway, because they're only going to have to pay for it to be finished.

 

I wouldn't worry too much to be honest.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.