Forum Moderators: coopster
Encoding links in the pages and then decoding on the fly through PHP when they are clicked is probably a good solution (it is too difficult to store them in a database and just number them in the pages, they change too often) This way I can check for how fast they are being requested, block abuse or slow down non-humans.
I am thinking perhaps some kind of strong key based encryption would slow down most people where the page compiler and the link decoder would know the long key.
But this type of coding is beyond my experience and google is only being helpful to find pre-package solutions.
Any ideas or snippets to get me started in the right direction?
(ps. portability to Perl would be a big plus but I am not being pickey right now)
Thanks for any help!
I'm not asking for some killer algorithm that is on the level of SSL or PGP, I just need something that is reasonably simple code and key based so they give up rather than waste the cpu time to crack.
Maybe I am not looking at the right application for attempts at this, maybe there is some PHP/javascript code I can mimic for password passing to a server.
PHP has base64_decode and base64_encode which if I could first scramble the url based on a key (password) would be very useful. I just don't know how to do that scrambling.
look at this, [phpfreaks.com...]
it's a combination of md5 and sha1. It doesn't take much time to create your own mod. It'll atleast take an hour or so for the sneakers to crack ;)
oh. btw if you can spare some time, try checking [hotwired.lycos.com...]
Just found another thread here on WW [webmasterworld.com] in the perl section with similar thoughts but unfortunately never solved.
However I am learning more and more, though wasting a huge amount of time on this.
What I have determined is I need to do a simple XOR on the URL with a password to scramble it and then base64 it so its webpage safe. I'll experiment to try to get this working.
It's a shame Blowfish is not installed with PHP generally (mcrypt) because the server I am using has blowfish extension for Perl. That would have been perfect.
what you combine with the link before you encode will help protect it. You can make it as complex as you like.
Remember they can examine whatever algorithm is in place by comparing the encoded url to the resulting url when they click.
From everything I have read up to this point, the problem is all my simple approaches are using symmetric encryption [en.wikipedia.org] when I really need an Asymmetric [en.wikipedia.org] system.
The learning part of this is fun, the fustration is not so much.
It is such a shame that perl has Blowfish [en.wikipedia.org] while php does not on my host!
then do a little of your own math to build something. Some of the encoding functions are a help as well.
You're right if there is a direct connection between the src data and the target data it will be figured out easily. I am not suggesting using a single function for anything, a combination of different mathematical processes and then a quick encode could work.
Nothing is uncrackable, you need to take reasonable precautions so that the time involved out weighs the gain.
I have a few encoding functions and this is roughly their outline but I won't post code for them, that would kind of defeat the purpose. ;)