惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
G
Google Developers Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
L
LangChain Blog
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
小众软件
小众软件
WordPress大学
WordPress大学
A
About on SuperTechFans
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
Jina AI
Jina AI
T
Tailwind CSS Blog
Google DeepMind News
Google DeepMind News
D
Docker

酷 壳 – CoolShell

感染新冠的经历 | 酷 壳 - CoolShell 从一次经历谈 TIME_WAIT 的那些事 | 酷 壳 - CoolShell 网络数字身份认证术 | 酷 壳 - CoolShell 我做系统架构的一些原则 | 酷 壳 - CoolShell 源代码特洛伊木马攻击 | 酷 壳 - CoolShell Go编程模式 : 泛型编程 | 酷 壳 - CoolShell 如何做一个有质量的技术分享 | 酷 壳 - CoolShell Go 编程模式:k8s Visitor 模式 | 酷 壳 - CoolShell Go编程模式:Pipeline | 酷 壳 - CoolShell Go编程模式:委托和反转控制 | 酷 壳 - CoolShell Go 编程模式:Go Generation | 酷 壳 - CoolShell Go编程模式:Map-Reduce | 酷 壳 - CoolShell Go 编程模式:错误处理 | 酷 壳 - CoolShell Go编程模式:切片,接口,时间和性能 | 酷 壳 - CoolShell 百度为什么掉队了 | 酷 壳 - CoolShell 程序员如何把控自己的职业 | 酷 壳 - CoolShell 计时攻击 Timing Attacks | 酷 壳 - CoolShell Rust语言的编程范式 | 酷 壳 - CoolShell HTTP的前世今生 | 酷 壳 - CoolShell 记一次Kubernetes/Docker网络排障 | 酷 壳 - CoolShell 可视化编程 | 酷 壳 - CoolShell 程序的本质复杂性和元语言抽象 | 酷 壳 - CoolShell 伙伴分配器的一个极简实现 | 酷 壳 - CoolShell C++11的Lambda使用一例:华容道求解 | 酷 壳 - CoolShell C++面试中string类的一种正确写法 | 酷 壳 - CoolShell C++模板”>>”编译问题与词法消歧设计 | 酷 壳 - CoolShell 数据即代码:元驱动编程 | 酷 壳 - CoolShell 数据的游戏:冰与火 | 酷 壳 - CoolShell 7个示例科普CPU Cache | 酷 壳 - CoolShell 加班与效率 | 酷 壳 - CoolShell
如何“加密”你的email地址 | 酷 壳 - CoolShell
陈皓 · 2011-01-27 · via 酷 壳 – CoolShell

现在在网上要小心,无论是保护好你的用户名和帐号,还是我们的电子邮件地址。在网上有很多爬虫程序专爬我们的电子邮件地址,一量被爬中了,那么你的邮箱里就是一堆又一堆的垃圾邮件,就好像我的haoel(at)hotmail.com一样,在7、8年前,每天几千封的垃圾邮件。现在hotmail的垃圾邮件过滤得好一些了,不过也有每天40封左右的垃圾邮件。但是我们在自己的网页上又需要发布自己的email地址。所以我们需要搞乱我们的邮件地址,就像那种非常规的搞乱代码一样。不过,我们还需要能认人读的出来。

一般来说,在网上现在很普遍的做法是——

  • 1)用图片,可以用PHP动态生成那个验证码式的。
  • 2)把@变成at,把点变成dot,如 haoel(at)hotmail(dot)com之类的。
  • 3)把a变成@,写成haoel@[email protected]

不过这些还是能被爬到,用图片的方法不利于用户拷贝粘贴。下面介绍几种方法:

第一种:使用CSS样式

反转字序

span.codedirection { unicode-bidi:bidi-override; direction: rtl; }
<p><span>moc.liamtoh@leoah</span></p>

加入些不显示的字符串

p span.hide { display:none; }
<p>foo@bar<span class="hide">null</span>.baz</p>

第二种:使用Javascript

最为简单的方法是:

[javascript]document.write("haoel" + "@" + "hotmail" + "." + "com");[/javascript]

或是:

[javascript]<script type="text/javascript">
<!–
var string1 = "@";
var string2 = "haoel";
var string3 = "hotmail.com";
var string4 = string2 + string1 + string3;
document.write("<a href=" + "mail" + "to:" + string2 + string1 + string3 + ">" + string4 + "</a>");
//–>
</script>[/javascript]

不过更为强大的是使用ROT13加密,这里有一个ROT13的在线工具,或是使用PHP的ROT13的函数str_rot13

[javascript]<script type=”text/javascript”>
document.write(“<n uers=\"znvygb:[email protected]\">”.replace(/[a-zA-Z]/g,
function(c){return String.fromCharCode((c<=”Z”?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);}));
</script>陈皓的电子邮件</a>[/javascript]

这些方法还是很有效果的。

Loading...