JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2061
Number of posts: 5164

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Fighting spam in a small way Posted by blip on 16 Aug 2003 at 6:16 PM
I decided to write a cheap little javascript that had an encrypted (extremely simple) e-mail address (mine, lol) and it would be decrypted for the user to be able to e-mail you. This may sound stupid, to encrypt it just to decrypt it, but spammers use programs to search for e-mail addresses in pages all over the internet and this will hide it. Well, unless of course they decide to script the page, which is unlikely. Like I said, it's pretty cheap and could've been written much better. Go ahead and improve it if you like and use it if you want.

<html>
<head>
<script language=javascript>
<!--
function Decrypt(EncryptedEmailAddress){
DecryptedEmailAddress=""
eea=EncryptedEmailAddress.length
CodeTable=" !\"#$%\&\'()*+,-./0123456789:;<=>?\
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
for(k=0;k<=eea;k++){
x=CodeTable.indexOf(EncryptedEmailAddress.substring(k,k+1))
if (x<0){
document.write("Error decrypting!")
return -1
}
else{
DecryptedEmailAddress=DecryptedEmailAddress+CodeTable.substring(x-1,x)
}
}
window.open("mailto:"+DecryptedEmailAddress)
}
//-->
</script>
<body bgcolor=000000 text=FFFFFF>
</head>
<input type=submit value="E-mail me!" onclick="Decrypt('cuipnqtpo78776Azbipp/dpn')">
</html>

Report
Re: Fighting spam in a small way Posted by WaltP on 16 Aug 2003 at 11:50 PM
: I decided to write a cheap little javascript that had an encrypted (extremely simple) e-mail address (mine, lol) and it would be decrypted for the user to be able to e-mail you. This may sound stupid, to encrypt it just to decrypt it, but spammers use programs to search for e-mail addresses in pages all over the internet and this will hide it. Well, unless of course they decide to script the page, which is unlikely. Like I said, it's pretty cheap and could've been written much better. Go ahead and improve it if you like and use it if you want.
:
:
: <html>
: <head>
: <script language=javascript>
: <!--
: function Decrypt(EncryptedEmailAddress){
: DecryptedEmailAddress=""
: eea=EncryptedEmailAddress.length
: CodeTable=" !\"#$%\&\'()*+,-./0123456789:;<=>?\
: @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
: for(k=0;k<=eea;k++){
: x=CodeTable.indexOf(EncryptedEmailAddress.substring(k,k+1))
: if (x<0){
: document.write("Error decrypting!")
: return -1
: }
: else{
: DecryptedEmailAddress=DecryptedEmailAddress+CodeTable.substring(x-1,x)
: }
: }
: window.open("mailto:"+DecryptedEmailAddress)
: }
: //-->
: </script>
: <body bgcolor=000000 text=FFFFFF>
: </head>
: <input type=submit value="E-mail me!" onclick="Decrypt('cuipnqtpo78776Azbipp/dpn')">
: </html>
: 

:

Take a look at the one I wrote at http://wildeware.com under utilities. There are offline versions available for GUI and Command line.



----------------
Walt


Report
Re: Fighting spam in a small way Posted by blip on 17 Aug 2003 at 9:48 AM
I once saw a CGI that returned many megs worth of plain text fake e-mail addresses for spam bots to chew up. Would you happen to know where it is?



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.