ASP Email Obfuscator
23.11.2003
Okuyucu : 10.548
Günlük Okuyucu : 6,4
Okuyucu : 10.548
Günlük Okuyucu : 6,4
Encode email addresses to make it harder for spammers to harvest them. Get more information from http://www.zapyon.de/spam-me-not/ Live Demonstaration - View Source
Kaynak Kodunu Download Edin (Download Source Code);
/opensource/source-code/obfuscate.txt
Kaynak Kod;
1 : <%
2 : '***********************************************************
3 : 'Copyright 2003 Ferruh Mavituna
4 : 'ASP Email Obfuscator v1.1
5 : 'http://ferruh.mavituna.com
6 : 'Encode email addresses to make it harder for spammers to harvest them.
7 : 'Inspired from http://www.zapyon.de/spam-me-not/
8 : '***********************************************************
9 : 'This program is free software; you can redistribute it and/or modify
10 : 'it under the terms of the GNU General Public License as published by
11 : 'the Free Software Foundation; either version 2 of the License, or
12 : '(at your option) any later version.
13 : '
14 : 'This program is distributed in the hope that it will be useful,
15 : 'but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : 'GNU General Public License for more details.
18 : '
19 : 'You should have received a copy of the GNU General Public License
20 : 'along with this program; if not, write to the Free Software
21 : 'Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 : '***********************************************************
23 : 'Details : http://www.gnu.org/licenses/gpl.txt
24 : '***********************************************************
26 : '***********************************************************
27 : '// USAGE
28 : '***********************************************************
29 : '// [1] Add fm_str2Arr, fm_decode, fm_obfuscate function into your page or include.
30 : '// [2] Print fm_obfuscate
31 : '// ARGUMENTS
32 : '// @email : String
33 : '// @method : Number (default=3)
34 : '// 1 : Decimal
35 : '// 2 : Hexadecimal
36 : '// 3 : Random
37 : '// @Optional Text : E-mail Text
38 : '// SAMPLE (see more in demonstrations -at the end of the code-)
39 : '// Response.Write fm_obfuscate("email@address.com",2,"Drop me a mail")
40 : '// OptText Encode Fixed
41 : '***********************************************************
44 : '******************************************************************
45 : '// Convert a String to Array by Ferruh Mavituna
46 : '******************************************************************
47 : Function fm_str2Arr(byVal Str, byRef Arr)
48 : Dim i, StrLen
49 : StrLen = Len(Str)-1
50 :
51 : Redim Arr(StrLen)
53 : For i = 0 to StrLen
54 : Arr(i)=Left(Str,1)
55 : If Len(Str)>0 Then Str=Right(Str,Len(Str)-1)
56 : Next
57 : End Function
60 : '******************************************************************
61 : '// Decode Characters by Ferruh Mavituna
62 : '******************************************************************
63 : Function fm_decode(byVal Char, byVal method)
64 : '// Randomize
65 : '***********************************
66 : If method=3 Then
67 : Randomize Timer
68 : method = CInt(Rnd*1)+1
69 : End If
71 : '// Select Method
72 : '***********************************
73 : Select Case method
74 : Case 1 '// Decimal Notation
75 : '***********************************
76 : fm_decode = Asc(Char)
78 : Case 2 '// Hexadecimal Notation
79 : '***********************************
80 : fm_decode = "x" & Hex(Asc(Char))
81 : End Select
82 : End Function
85 : Function fm_obfuscate(byVal email,byVal method, byval OptText)
86 : Dim tmpStr, mailArr(), i, finalStr, mailtoArr(), tmpMailtoStr, OptStrArr()
88 : '// Fix method
89 : If NOT isNumeric(method) Then method = 3
90 : If method>3 Then method = 3
92 : '// Encode "mailto:"
93 : fm_str2Arr "mailto:",mailtoArr
94 : For i = 0 To Ubound(mailtoArr)
95 : tmpMailtoStr = tmpMailtoStr & "&#" & fm_decode(mailtoArr(i),method) & ";"
96 : Next
98 : '// Convert String to Array
99 : '***********************************
100 : fm_str2Arr email,mailArr
101 :
102 : '// Generate Text
103 : '***********************************
104 : For i = 0 To Ubound(mailArr)
105 : finalStr = finalStr & "&#" & fm_decode(mailArr(i),method) & ";"
106 : Next
108 : '// Fix OptionText
109 : '***********************************
110 : If OptText="" Then
111 : OptText = finalStr
112 : Else
113 : fm_str2Arr OptText,OptStrArr
114 : '// Generate Text
115 : '***********************************
116 : OptText=""
117 : For i = 0 To Ubound(mailArr)
118 : OptText = OptText & "&#" & fm_decode(mailArr(i),method) & ";"
119 : Next
120 : End If
121 : finalStr = tmpMailtoStr & finalStr
123 : '// Return
124 : '***********************************
125 : fm_obfuscate = "<a href=""" & finalStr & """>" & OptText & "</a><br />"
126 : End Function
128 : '***********************************
129 : '***********************************
130 : '// Demonstrations
131 : '***********************************
132 : '***********************************
133 : Response.Write "by <a href=""http://ferruh.mavituna.com"">Ferruh Mavituna</a> | <a href=""http://ferruh.mavituna.com/opensource/obfuscate/obfuscate.txt"">Download Source Code</a><p>"
134 : '// Decimal
135 : '***********************************
136 : Response.Write "<h1>Decimal</h1>"
137 : Response.Write fm_obfuscate("whoooo@yupyupgup.com",1,"")
139 : '// Decimal with Text
140 : '***********************************
141 : Response.Write "<h1>Decimal with Text</h1>"
142 : Response.Write fm_obfuscate("whoooo@yupyupgup.com",1,"Drop me a mail")
144 : '// Hexadecimal
145 : '***********************************
146 : Response.Write "<h1>Hexadecimal</h1>"
147 : Response.Write fm_obfuscate("whoooo@yupyupgup.com",2,"")
149 : '// Hexadecimal with Text
150 : '***********************************
151 : Response.Write "<h1>Hexadecimal with Text</h1>"
152 : Response.Write fm_obfuscate("whoooo@yupyupgup.com",2,"Drop me a mail")
154 : '// Random
155 : '***********************************
156 : Response.Write "<h1>Random</h1>"
157 : Response.Write fm_obfuscate("whoooo@yupyupgup.com",3,"")
159 : '// Random with Text
160 : '***********************************
161 : Response.Write "<h1>Random with Text</h1>"
162 : Response.Write fm_obfuscate("whoooo@yupyupgup.com",5,"Drop me a mail")
164 : '// See Real Results
165 : '***********************************
166 : 'Response.Write Server.HTMLEncode(fm_obfuscate("whoooo@yupyupgup.com",1,""))
167 : 'Response.Write Server.HTMLEncode(fm_obfuscate("whoooo@yupyupgup.com",1,"Drop me a mail"))
168 : 'Response.Write Server.HTMLEncode(fm_obfuscate("whoooo@yupyupgup.com",2,""))
169 : 'Response.Write Server.HTMLEncode(fm_obfuscate("whoooo@yupyupgup.com",2,"Drop me a mail"))
170 : 'Response.Write Server.HTMLEncode(fm_obfuscate("whoooo@yupyupgup.com",3,""))
171 : 'Response.Write Server.HTMLEncode(fm_obfuscate("whoooo@yupyupgup.com",3,"Drop me a mail"))
172 : %>

Yorumlar
Yorum Ekle
Diğer Yazılar
ASP Secure Word Analizleri
ASP Template Sistemi
ASP ve ASP.NET arasında Session paylaşımı
ASP ve İbranice veya başka birşey...
ASP.NET / VB.NET ile Döviz Kurlarını Çekme (TCMB XML)
ASP.NET BreadCrumb Class' ı (Neredeyim? şeysi)
ASP.NET ile Döviz Kurlarını Çekme
ASP.NET ile geliştirme keyfi
ASP.NET Kod Örnekleri
ASP.NET Sayfa Çıktısını Yakalama
ASP.NET' te basit template mantığı
ASP.NET Web Deployment
ASPRunner Güvenlik Açıkları
ASPRunner Multiple Vulnerabilities
ASP-XML Entegrasyonu
Assassin's Creed
aSSL - Ajax ile SSL
Astalavista.box.sk yı kim blokladı ?
ATLAS, Sakat Aktivite İzleyici
Neredeyim ?
Ferruh.Mavituna » Kod Parçaları (Code Snippets) » ASP Email Obfuscator