View Full Version : Text Obfuscate
thalamus
12-09-2005, 10:15 AM
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
12-09-2005, 10:17 AM
How would users decode it?
thalamus
12-09-2005, 10:30 AM
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
12-09-2005, 12:00 PM
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
12-09-2005, 12:35 PM
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
12-09-2005, 01:33 PM
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...
https://vborg.vbsupport.ru/showthread.php?t=97704&highlight=email+address+obfuscator
thalamus
12-09-2005, 02:07 PM
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
12-11-2005, 07:35 AM
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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.