condoravenue Posted September 9, 2011 Share Posted September 9, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/246761-best-way-to-prevent-view-source-code/ Share on other sites More sharing options...
ZulfadlyAshBurn Posted September 9, 2011 Share Posted September 9, 2011 ive tried too. but its rather hard... Quote Link to comment https://forums.phpfreaks.com/topic/246761-best-way-to-prevent-view-source-code/#findComment-1267263 Share on other sites More sharing options...
Adam Posted September 9, 2011 Share Posted September 9, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/246761-best-way-to-prevent-view-source-code/#findComment-1267273 Share on other sites More sharing options...
ZulfadlyAshBurn Posted September 9, 2011 Share Posted September 9, 2011 usually I would convert the website into an image and send them or I would use ioncube to encrypt it on my server. Quote Link to comment https://forums.phpfreaks.com/topic/246761-best-way-to-prevent-view-source-code/#findComment-1267298 Share on other sites More sharing options...
Adam Posted September 9, 2011 Share Posted September 9, 2011 usually I would convert the website into an image That's a better idea. Quote Link to comment https://forums.phpfreaks.com/topic/246761-best-way-to-prevent-view-source-code/#findComment-1267300 Share on other sites More sharing options...
ZulfadlyAshBurn Posted September 9, 2011 Share Posted September 9, 2011 usually I would convert the website into an image That's a better idea. thanks Quote Link to comment https://forums.phpfreaks.com/topic/246761-best-way-to-prevent-view-source-code/#findComment-1267303 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.