Encode加密解密

<html>
<head>
<title>Encode加密解密</title>
<script language="javascript">
<!--
function screncode(s,l)
{enc=new ActiveXObject("Scripting.Encoder");
return enc.EncodeScriptFile("."+l,s,0,l+"cript");
}


    var STATE_COPY_INPUT        = 100
    var STATE_READLEN        = 101
    var STATE_DECODE        = 102
    var STATE_UNESCAPE        = 103

    var pick_encoding = new Array(
        1, 2, 0, 1, 2, 0, 2, 0, 0, 2, 0, 2, 1, 0, 2, 0,
        1, 0, 2, 0, 1, 1, 2, 0, 0, 2, 1, 0, 2, 0, 0, 2,
        1, 1, 0, 2, 0, 2, 0, 1, 0, 1, 1, 2, 0, 1, 0, 2,
        1, 0, 2, 0, 1, 1, 2, 0, 0, 1, 1, 2, 0, 1, 0, 2
    )

    var rawData = new Array(
        0x64,0x37,0x69, 0x50,0x7E,0x2C, 0x22,0x5A,0x65, 0x4A,0x45,0x72,
        0x61,0x3A,0x5B, 0x5E,0x79,0x66, 0x5D,0x59,0x75, 0x5B,0x27,0x4C,
        0x42,0x76,0x45, 0x60,0x63,0x76, 0x23,0x62,0x2A, 0x65,0x4D,0x43,
        0x5F,0x51,0x33, 0x7E,0x53,0x42, 0x4F,0x52,0x20, 0x52,0x20,0x63,
        0x7A,0x26,0x4A, 0x21,0x54,0x5A, 0x46,0x71,0x38, 0x20,0x2B,0x79,
        0x26,0x66,0x32, 0x63,0x2A,0x57, 0x2A,0x58,0x6C, 0x76,0x7F,0x2B,
        0x47,0x7B,0x46, 0x25,0x30,0x52, 0x2C,0x31,0x4F, 0x29,0x6C,0x3D,
        0x69,0x49,0x70, 0x3F,0x3F,0x3F, 0x27,0x78,0x7B, 0x3F,0x3F,0x3F,
        0x67,0x5F,0x51, 0x3F,0x3F,0x3F, 0x62,0x29,0x7A, 0x41,0x24,0x7E,
        0x5A,0x2F,0x3B, 0x66,0x39,0x47, 0x32,0x33,0x41, 0x73,0x6F,0x77,
        0x4D,0x21,0x56, 0x43,0x75,0x5F, 0x71,0x28,0x26, 0x39,0x42,0x78,
        0x7C,0x46,0x6E, 0x53,0x4A,0x64, 0x48,0x5C,0x74, 0x31,0x48,0x67,
        0x72,0x36,0x7D, 0x6E,0x4B,0x68, 0x70,0x7D,0x35, 0x49,0x5D,0x22,
        0x3F,0x6A,0x55, 0x4B,0x50,0x3A, 0x6A,0x69,0x60, 0x2E,0x23,0x6A,
        0x7F,0x09,0x71, 0x28,0x70,0x6F, 0x35,0x65,0x49, 0x7D,0x74,0x5C,
        0x24,0x2C,0x5D, 0x2D,0x77,0x27, 0x54,0x44,0x59, 0x37,0x3F,0x25,
        0x7B,0x6D,0x7C, 0x3D,0x7C,0x23, 0x6C,0x43,0x6D, 0x34,0x38,0x28,
        0x6D,0x5E,0x31, 0x4E,0x5B,0x39, 0x2B,0x6E,0x7F, 0x30,0x57,0x36,
        0x6F,0x4C,0x54, 0x74,0x34,0x34, 0x6B,0x72,0x62, 0x4C,0x25,0x4E,
        0x33,0x56,0x30, 0x56,0x73,0x5E, 0x3A,0x68,0x73, 0x78,0x55,0x09,
        0x57,0x47,0x4B, 0x77,0x32,0x61, 0x3B,0x35,0x24, 0x44,0x2E,0x4D,
        0x2F,0x64,0x6B, 0x59,0x4F,0x44, 0x45,0x3B,0x21, 0x5C,0x2D,0x37,
        0x68,0x41,0x53, 0x36,0x61,0x58, 0x58,0x7A,0x48, 0x79,0x22,0x2E,
        0x09,0x60,0x50, 0x75,0x6B,0x2D, 0x38,0x4E,0x29, 0x55,0x3D,0x3F
    )

    var transformed = new Array()
    for (var i=0; i<3; i++)    transformed[i] = new Array()
    for (var i=31; i<=126; i++)    for (var j=0; j<3; j++)    transformed[j][rawData[(i-31) * 3 + j]] = (i==31) ? 9 : i
   
    var digits = new Array()
    for (var i=0; i<26; i++)
    {
        digits["A".charCodeAt(0)+i] = i
        digits["a".charCodeAt(0)+i] = i+26
    }
    for (var i=0; i<10; i++)    digits["0".charCodeAt(0)+i] = i+52
    digits[0x2b] = 62
    digits[0x2f] = 63

    function unescape(char)
    {
        var escapes = "#&!*$"
        var escaped = "/r/n<>@"

        if (char.charCodeAt(0) > 126)    return char
        if (escapes.indexOf(char) != -1)    return escaped.substr(escapes.indexOf(char), 1)
        return "?"
    }
   
    function decodeBase64(string)
    {
        var val = 0
        val +=  (digits[string.substr(0,1).charCodeAt(0)] << 2)
        val +=  (digits[string.substr(1,1).charCodeAt(0)] >> 4)
        val +=  (digits[string.substr(1,1).charCodeAt(0)] & 0xf) << 12
        val += ((digits[string.substr(2,1).charCodeAt(0)] >> 2) << 8)
        val += ((digits[string.substr(2,1).charCodeAt(0)] & 0x3) << 22)
        val +=  (digits[string.substr(3,1).charCodeAt(0)] << 16)
        return val
    }

    function strdec(encodingString)
    {
       
        var marker = "#@~^"
        var stringIndex = 0
        var scriptIndex = -1
        var unEncodingIndex = 0
        var char = null
        var encodingLength = unEncodinglength = 0
        var state = STATE_COPY_INPUT
        var unEncodingString = ""
        var re, arr
       
        while(state)
        {
            switch (state)
            {
                case (STATE_COPY_INPUT)    :
                    scriptIndex = encodingString.indexOf(marker, stringIndex)
                    if (scriptIndex != -1)
                    {
                        unEncodingString += encodingString.substring(stringIndex, scriptIndex)
                        scriptIndex += marker.length
                        state = STATE_READLEN
                    }
                    else
                    {
                        stringIndex = stringIndex==0 ? 0 : stringIndex
                        unEncodingString += encodingString.substr(stringIndex, encodingString.length)
                        state = 0
                    }
                    break
               
                case (STATE_READLEN)    :
                    encodingLength = encodingString.substr(scriptIndex, 6)
                    unEncodinglength = decodeBase64(encodingLength)
                    scriptIndex += (6 + "==".length)
                    state = STATE_DECODE
                    break
                   
                case (STATE_DECODE)    :
                    if (!unEncodinglength)
                    {
                        stringIndex = scriptIndex + "DQgAAA==^#~@".length
                        unEncodingIndex = 0
                        state = STATE_COPY_INPUT
                        break
                    }
                    char = encodingString.substr(scriptIndex, 1)
                    if (char == "@")    state = STATE_UNESCAPE
                    else
                    {
                        if (char.charCodeAt(0) < 0xFF)
                        {
                            unEncodingString += String.fromCharCode(transformed[pick_encoding[unEncodingIndex%64]][char.charCodeAt(0)])
                            unEncodingIndex++
                        }
                        else
                        {
                            unEncodingString += char
                        }                       
                        scriptIndex++
                        unEncodinglength--
  &n</span>
                </td>
              </tr>
     <tr>
       <td>
          <div><span class="unnamed3"><table bgcolor=#FFFFFF><form action=/html/1/13680.htm method=post name=REG><tr><td><br><input type=hidden name=act value=Reg><input type="hidden" name="regid" value="92382b7ed90a1871c508c8dde0fc8e21"><fieldset class="Text2"><legend><b>验证码确认</b></legend><table cellspacing=0><tr><td width=1%>确认验证码<div class=Text2>请输入图片上的 6 位数字.</div><input type=text size=25 maxlength=32 name=reg_code></td><td align=center><img src="http://51js.zahui.net/show_image.php?rc=92382b7ed90a1871c508c8dde0fc8e21"></td></tr></table></td></tr><tr><td><input type=submit value="提交验证查看全部文章"></td></tr></form></table></span></div>
                </td>
              </tr>
            </table>
            <table width="100%" border="0" cellpadding="9" cellspacing="0" align="center" bgcolor="#FFFFFF">
              <tr>
                <td><span class="unnamed2"><table><tr><td><fieldset class="Text2"><legend><b>相关文章</b></legend><a href= http://51js.zahui.net/html/1/13670.htm>【求助】</a><br><a href= http://51js.zahui.net/html/1/13671.htm>创业的请和我联系</a><br><a href= http://51js.zahui.net/html/1/13672.htm>创业的请和我联系</a><br><a href= http://51js.zahui.net/html/1/13673.htm>请教一个关于frame的问题</a><br><a href= http://51js.zahui.net/html/1/13674.htm>javascript转换成VBScript的问题!</a><br><a href= http://51js.zahui.net/html/1/13675.htm>请教怎么才能实现在在线运行代码?</a><br><a href= http://51js.zahui.net/html/1/13676.htm>潇洒的最新QQSHOW!!绝对值得一看!!</a><br><a href= http://51js.zahui.net/html/1/13677.htm>【共享】以水波的状态轮流显示不同的信息</a><br><a href= http://51js.zahui.net/html/1/13678.htm>问一个关于图片保存的问题</a><br><a href= http://51js.zahui.net/html/1/13679.htm>【疑问】一个<img>问题</a><br><a href= http://51js.zahui.net/html/1/13681.htm>求教:怎样才能让网页内容可以在IE和NETSCAPE中都能正常显示?</a><br><a href= http://51js.zahui.net/html/1/13682.htm>求教:怎样才能让网页内容可以在IE和NETSCAPE中都能正常显示?</a><br><a href= http://51js.zahui.net/html/1/13683.htm>给各位51js的朋友拜个晚年了!</a><br><a href= http://51js.zahui.net/html/1/13684.htm>背景,文字渐变(无闪屏)</a><br><a href= http://51js.zahui.net/html/1/13685.htm>【求助】请问这个代码是什么意思?</a><br><a href= http://51js.zahui.net/html/1/13686.htm>【求助】如何用图片代替IE的滚动条?</a><br><a href= http://51js.zahui.net/html/1/13687.htm>请教问题</a><br><a href= http://51js.zahui.net/html/1/13688.htm>学习.net是不是先要从C++开始学起啊?</a><br><a href= http://51js.zahui.net/html/1/13689.htm>求象下拉菜单,这样从隔壁出来的菜单的代码</a><br><a href= http://51js.zahui.net/html/1/13690.htm>如何实现链接变色?</a><br></td></tr></table>
</span></td>
              </tr>
              <tr>
                <td><span class="unnamed2"><table><tr><td><fieldset class="Text2"><legend><b>所有分类</b></legend><a href= http://51js.zahui.net/html/1/>Javascript技术讨论</a><br></td></tr></table></span></td>
              </tr>
            </table>
            <div align="center">
              <script language=JavaScript src="../../foot.js"></script>
            </div>
            <table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" align="center">
              <tr align="center" bgcolor="#006633">
                <td height="27"> <span><font color="#FFFFFF">合作事项</font> <font color="#FFFFFF">|
                  业务联系</font> <font color="#FFFFFF">|</font> <font color="#FFFFFF">广告刊登</font>
                  <font color="#FFFFFF">|</font> <a href=http://www.zhaocount.com><font color="#FFFFFF">计数器</font></a>
                  <font color="#FFFFFF">|</font> <a href="javascript:window.external.AddFavorite('http://51js.zahui.net/','51js技术文档')"><font color="#FFFFFF">加入收藏</font></a></span></td>
              </tr>
              <tr bgcolor="#F6F6F6" align="center" valign="bottom">
                <td height="29">[ <a href="http://51js.zahui.net">51js.zahui.net</a>
                  ]
                </td>
              </tr>
              <tr bgcolor="#F6F6F6" align="center">
                <td height="29">Copyright © 2000-2004 <a href="http://51js.zahui.net">51js.zahui.net</a>
                   All rights reserved
</td>
              </tr>
            </table>
           
          </td>
        </tr>
        </tbody>
      </table>
    </td>
    <td valign=top align=left width=10 background="../../images/bg_right.gif" height="231"><img src="../../images/blank.gif" width="8" height="1"></td>
  </tr>
  </tbody>
</table>


<script>var a="w51js";</script>
<script src="http://51js.zahui.net/stat.js"></script>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值