PDA

View Full Version : Text Obfuscate


thalamus
09 Dec 2005, 12:15
I'm trying to find something that will allow me to add a set of bbcode tags (something like text here which, although showing the text on the post, will basically encode the output on the searchable page to an 'encode64' result - this to avoid search engines etc from picking up on the "text here" and thereby adding a little security to what's posted.

I'm sure I saw this somewhere before and if anyone's done this I'd appreciate any info rather than having to reinvent the wheel. Please? TIA.

Andreas
09 Dec 2005, 12:17
How would users decode it?

thalamus
09 Dec 2005, 12:30
Automated, hopefully - simply, the user would post thus:

"I spoke to Andrew Smith today and we were talking about...."

so the post itself would read:

"I spoke to Andrew Smith today and we were talking about..."

but the View Source on the html page itself would read:

"I spoke to gtYdhjdjijrh8aeh today and we were talking about... "

so that the actual name, for instance, could not be seen by search bots/spiders. This would add a certain safety to any posts that may contain names and such who's privacy is to be respected. I was thinking of using a base64 javascript function for this, would this be the best way to go?

Marco van Herwaarden
09 Dec 2005, 14:00
Impossible!

If it shows to the user, it is in the html source. You could however create 1 that would not display to guests.

thalamus
09 Dec 2005, 14:35
hmm - I think its possible by using javascript so that the view source would say something like:

""I spoke to <script type="javascript">document.write(base64_decode('gtYdhjdjijrh8aeh'))</script> today and we were talking about... "

but I'm sure there's no such function built in... or am I wrong?

sully02
09 Dec 2005, 15:33
hmm - I think its possible by using javascript so that the view source would say something like:

""I spoke to <script type="javascript">document.write(base64_decode('gtYdhjdjijrh8aeh'))</script> today and we were talking about... "

but I'm sure there's no such function built in... or am I wrong?

I know there is a product/plugin here that obfuscates email addresses on the boards. Let me link you to that, perhaps you can work on that to get what you need...

http://www.vbulletin.org/forum/showthread.php?t=97704&highlight=email+address+obfuscator

thalamus
09 Dec 2005, 16:07
Thanks for the link - I've had a look and it's not quite the solution I'm looking for. I'll have to see how I can get it to be set up within the class_bbcode.php and find the hooks that will be needed to parse it up. Looks like I'll have to use the php base64_encode() function within the parser, then use a javascript decode as document.write (as above) to reproduce the original text on the posts. I'll keep this thread posted as to my progress ;)

thalamus
11 Dec 2005, 09:35
Well for anyone who's interested, I managed to work this out although it meant adding code to two php files (class_bbcode.php and class_bbcode_alt.php) and adding a function to vbulletin_global.js.

Basically I'm using the php function base64_encode within the class_bbcode.php call when parsing the text for the tag, and returning a html string that contains a javascript call to a decode64 function that I've added to the .js file. Seems to work great, and the html return string can also have a 'span style=color:' tag to highlight the obfuscated word.

If anyone wants the code and instructions (I have no idea how to write it up as a plugin etc) let me know.