Encrypting an Html
Moderator: General Moderators
Encrypting an Html
I don't want to go too technical but I came up with a simple idea that will keep people away for a while. Can someone show me how to make a php code that will make all of the html addresses in any html/php documents in the ftp folder flip around, so the html address is backward. I know that will be easy, but how would I make it so it also recognizes it and automaticaly flips it around to read it..
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
strrev() flips around text, but there's several problems in implementing this:Can someone show me how to make a php code that will make all of the html addresses in any html/php documents in the ftp folder flip around, so the html address is backward.
http:// is a protocol. You can't take "http://www.google.com/" and flip it around to "/moc.elgoog.www//:ptth" and expect the server to even get the request.
Therefore, you'd probably have to flip around just the folder variables and leave the domain name alone. But I have a better idea:
Why don't you have Apache force a user to authenticate itself before it serves any requests? If you're trying to "keep people away". Or you could swamp your site with annoying ads and popups. That would keep people away too. </sarcasm>
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
If you're trying to make it hard for them to find (but not impossible), and you've got lots of free time on your hands:
1. Devise a puzzle program they have to solve before they can download the file.
2. Swamp the site in ads, making them click through lots of things and vote for you in site polls and stuff, and then finally get to the end where the file is there but mispelled.
1. Devise a puzzle program they have to solve before they can download the file.
2. Swamp the site in ads, making them click through lots of things and vote for you in site polls and stuff, and then finally get to the end where the file is there but mispelled.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
If they're in HTML files, that's impossible without editing the HTML file into a PHP file (two ways, rename it PHP or have Apache parse HTML files under PHP). Then, I'd suggest at the beginning of the document do output buffering. Then, using a regexp, find the locations of all the URLs in the document. Then, with the locations, decompose the URLs, keep the http://www.domain.com/ and then reverse everything after that.
BUT IT DOESN'T WORK! If you have Apache reverse the URL obfuscation via mod_rewrite or something, they can still use the URLs! Nothing changes!
I'm still not sure what you want to do. Perhaps it would be time better spent making a PHP script that slurps up all of the links to downloads (and associated metadata), put it into a database, and then have all links generated dynamically?
BUT IT DOESN'T WORK! If you have Apache reverse the URL obfuscation via mod_rewrite or something, they can still use the URLs! Nothing changes!
I'm still not sure what you want to do. Perhaps it would be time better spent making a PHP script that slurps up all of the links to downloads (and associated metadata), put it into a database, and then have all links generated dynamically?
http://scriptasylum.com/tutorials/encde ... ecode.html
It'd be quite simply to write a PHP script to encode the existing HTML and then wrap it in a page that decodes it on the client side.
But if anyone has JavaScript switched off they'd not be able to view the page.
It'd be quite simply to write a PHP script to encode the existing HTML and then wrap it in a page that decodes it on the client side.
But if anyone has JavaScript switched off they'd not be able to view the page.
No, I'm completely serious.FTJoe wrote:Is that being sarcastic because I'm stupid, or are you serious?
Roughly speaking, the script would go something like:
Code: Select all
$dir = opendir("./directoryOfHTMLFiles/");
while ($file = readdir($dir)) {
if ($file != "." and $file != "..") {
//Open the file
//Strip out the header HTML and <body> tag
//Encode the data
//Add the JavaScript encoding stuff
//Save the file
}
}