How to encrypt the Email address?

Source: Internet
Author: User

How to encrypt the Email address?

Email Address encryption code:

<Code> <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/> </code>

<Style type = "text/css"> <! -
Body {font-size: 12px ;}
-> </Style> <script type = "text/javascript" language = "javascript"> // <! [CDATA [
Var email = "davidz94@yahoo.com ";
Function getEmail (email)
{
Var r = "";
For (I = 0; I <email. length; I ++)
{
R + = "& #" + email. charCodeAt (I );
}
Return r;
}

Function setClipboard (id)
{
Var tb = document. getElementById (id );
Var copytext = tb. value;
If (copytext! = "")
{
If (window. clipboardData)
{
Window. clipboardData. setData ("Text", copytext );
Alert ("copied to clipboard. ");
}
Else if (window. netscape)
{
SetClipboardNetscape (copytext );
Alert ("copied to clipboard. ");
}
}
Return false;
}

Function setClipboardNetscape (text ){
Var url = [
'Data: text/html; charset = UTF-8; base64, PGJvZHk + PC9ib2 ',
'R5pjxzy3jpchqgdhlwzt0idgv4dc9qyxzhc2nyaxb0ij4kkgz1 ',
'Bmn0aw9ukgvuy29kzwqpe3zhcibzd2zfzgf0ysa9ifskicdkyx ',
'Fig ',
'Ncxrmwruqjj3jywkicdbqufcng5eugdzbgpbd01qstrnejalmk ',
'Ylmky5jtjgztjazkjnyudhv3dnre1unuthjywkicdrtu10tjrh ',
'Zgdaz1njtxdawezkyw01uuffjtjcqm9iatfctg5utxldcfb6rw ',
'9ou0djjywkicdqrnalmkzbehnerejra3bgwkrguuzgq2d1evm4 ',
'Qxlqstrbrvvcaxkwvndbjtnejtne1_pdlmpvaw4oiiipowpkb2 ',
'N1bwvudc5ib2r5lmlubmvysfrntca9ifskicc8zw1izwqgc3jj ',
'Psinlhn3zl9kyxrhlcciiccscianrmxhc2hwyxjzpsjb2rlps ',
'Cszw5jb2rlzcwnij4nlaogjzwvzw1izwq + rjpdlmpvaw4oiiip ',
'Owp9ksgi ',
Base64encode (encodeURIComponent (text) + '") </' + 'script> ')
]. Join ("");
Var tmp = document. createElement ("div ");
Tmp. innerHTML = [
'<Iframe src = "', url, '"', 'width = "0" height = "0">'
, '</Iframe>'
]. Join ("");
With (tmp. style ){
Position = "absolute ";
Left = "-10px ";
Top = "-10px ";
Visibility = "hidden ";
};
Document. body. appendChild (tmp );
SetTimeout (function () {document. body. removeChild (tmp)}, 1000 );
Function base64encode (str ){
Var Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 +/". split ("");
Var c1, c2, c3;
Var buf = [];
Var len = str. length;
Var I = 0;
While (I <len) {c1 = str. charCodeAt (I) & #038; 0xff; c2 = str. charCodeAt (I + 1); c3 = str. charCodeAt (I + 2); buf. push (Chars [(c1> 2)]);
If (I + 1 = len ){
Buf. push (Chars [(c1 & #038; 0x3) <4], "= ");
Break;
}
Buf. push (Chars [(c1 & #038; 0x3) <4) | (c2 & #038; 0xF0)> 4)]);
If (I + 2 = len ){
Buf. push (Chars [(c2 & #038; 0xF) <2], "= ");
Break;
}
Buf. push (
Chars [(c2 & #038; 0xF) <2) | (c3 & #038; 0xC0)> 6)],
Chars [(c3 & #038; 0x3F)]
);
I + = 3;
}
Return buf. join ("")
}
}
//]> </Script>

& Nbsp;

<Strong> Email address encryption </strong>

Email:
<Input id = "email" type = "hidden" name = "email" size = "50" value = "www54@66mo.biz"/>
<Input onclick = "document. getElementById ('export '). value = getEmail (document. getElementById ('email '). value) "type =" button "name =" Submit "value =" "/>

<Input onclick = "document. getElementById ('preview '). innerHTML = getEmail (document. getElementById ('email '). value) "type =" button "name =" Submit2 "value =" click to view Email "/> <span id =" preview "style =" color: # ff0000; "> </span>

Result:
<Input id = "export" type = "text" name = "export" size = "76"/>

& Nbsp;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.