开发者社区> 问答> 正文

前端密码传输加密,这是什么加密:报错

是这样看到一个前端把用户名密码和验证码通过js加密传输到后台,请问这个是什么加密。怎么在后台解密。请教大牛们

var _16 = {
    _6: 8,
    _3: function(i, m, k, l, j, h, n) {
        return this._8(m & k | ~m & l, i, m, j, h, n)
    },
    _2: function(i, m, k, l, j, h, n) {
        return this._8(m & l | k & ~l, i, m, j, h, n)
    },
    _7: function(i, t) {
        i[t >> 5] |= 128 << t % 32;
        i[(t + 64 >>> 9 << 4) + 14] = t;
        for (var n = 1732584193,
        o = -271733879,
        j = -1732584194,
        v = 271733878,
        u = 0; u < i.length; u += 16) {
            var s = n,
            r = o,
            q = j,
            p = v,
            n = this._3(n, o, j, v, i[u + 0], 7, -680876936),
            v = this._3(v, n, o, j, i[u + 1], 12, -389564586),
            j = this._3(j, v, n, o, i[u + 2], 17, 606105819),
            o = this._3(o, j, v, n, i[u + 3], 22, -1044525330),
            n = this._3(n, o, j, v, i[u + 4], 7, -176418897),
            v = this._3(v, n, o, j, i[u + 5], 12, 1200080426),
            j = this._3(j, v, n, o, i[u + 6], 17, -1473231341),
            o = this._3(o, j, v, n, i[u + 7], 22, -45705983),
            n = this._3(n, o, j, v, i[u + 8], 7, 1770035416),
            v = this._3(v, n, o, j, i[u + 9], 12, -1958414417),
            j = this._3(j, v, n, o, i[u + 10], 17, -42063),
            o = this._3(o, j, v, n, i[u + 11], 22, -1990404162),
            n = this._3(n, o, j, v, i[u + 12], 7, 1804603682),
            v = this._3(v, n, o, j, i[u + 13], 12, -40341101),
            j = this._3(j, v, n, o, i[u + 14], 17, -1502002290),
            o = this._3(o, j, v, n, i[u + 15], 22, 1236535329),
            n = this._2(n, o, j, v, i[u + 1], 5, -165796510),
            v = this._2(v, n, o, j, i[u + 6], 9, -1069501632),
            j = this._2(j, v, n, o, i[u + 11], 14, 643717713),
            o = this._2(o, j, v, n, i[u + 0], 20, -373897302),
            n = this._2(n, o, j, v, i[u + 5], 5, -701558691),
            v = this._2(v, n, o, j, i[u + 10], 9, 38016083),
            j = this._2(j, v, n, o, i[u + 15], 14, -660478335),
            o = this._2(o, j, v, n, i[u + 4], 20, -405537848),
            n = this._2(n, o, j, v, i[u + 9], 5, 568446438),
            v = this._2(v, n, o, j, i[u + 14], 9, -1019803690),
            j = this._2(j, v, n, o, i[u + 3], 14, -187363961),
            o = this._2(o, j, v, n, i[u + 8], 20, 1163531501),
            n = this._2(n, o, j, v, i[u + 13], 5, -1444681467),
            v = this._2(v, n, o, j, i[u + 2], 9, -51403784),
            j = this._2(j, v, n, o, i[u + 7], 14, 1735328473),
            o = this._2(o, j, v, n, i[u + 12], 20, -1926607734),
            n = this._1(n, o, j, v, i[u + 5], 4, -378558),
            v = this._1(v, n, o, j, i[u + 8], 11, -2022574463),
            j = this._1(j, v, n, o, i[u + 11], 16, 1839030562),
            o = this._1(o, j, v, n, i[u + 14], 23, -35309556),
            n = this._1(n, o, j, v, i[u + 1], 4, -1530992060),
            v = this._1(v, n, o, j, i[u + 4], 11, 1272893353),
            j = this._1(j, v, n, o, i[u + 7], 16, -155497632),
            o = this._1(o, j, v, n, i[u + 10], 23, -1094730640),
            n = this._1(n, o, j, v, i[u + 13], 4, 681279174),
            v = this._1(v, n, o, j, i[u + 0], 11, -358537222),
            j = this._1(j, v, n, o, i[u + 3], 16, -722521979),
            o = this._1(o, j, v, n, i[u + 6], 23, 76029189),
            n = this._1(n, o, j, v, i[u + 9], 4, -640364487),
            v = this._1(v, n, o, j, i[u + 12], 11, -421815835),
            j = this._1(j, v, n, o, i[u + 15], 16, 530742520),
            o = this._1(o, j, v, n, i[u + 2], 23, -995338651),
            n = this._0(n, o, j, v, i[u + 0], 6, -198630844),
            v = this._0(v, n, o, j, i[u + 7], 10, 1126891415),
            j = this._0(j, v, n, o, i[u + 14], 15, -1416354905),
            o = this._0(o, j, v, n, i[u + 5], 21, -57434055),
            n = this._0(n, o, j, v, i[u + 12], 6, 1700485571),
            v = this._0(v, n, o, j, i[u + 3], 10, -1894986606),
            j = this._0(j, v, n, o, i[u + 10], 15, -1051523),
            o = this._0(o, j, v, n, i[u + 1], 21, -2054922799),
            n = this._0(n, o, j, v, i[u + 8], 6, 1873313359),
            v = this._0(v, n, o, j, i[u + 15], 10, -30611744),
            j = this._0(j, v, n, o, i[u + 6], 15, -1560198380),
            o = this._0(o, j, v, n, i[u + 13], 21, 1309151649),
            n = this._0(n, o, j, v, i[u + 4], 6, -145523070),
            v = this._0(v, n, o, j, i[u + 11], 10, -1120210379),
            j = this._0(j, v, n, o, i[u + 2], 15, 718787259),
            o = this._0(o, j, v, n, i[u + 9], 21, -343485551),
            n = this._4(n, s),
            o = this._4(o, r),
            j = this._4(j, q),
            v = this._4(v, p)
        }
        return [n, o, j, v]
    },
    _5: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),
    _13: function(i) {
        for (var m = [], k = i.length, l = 0; l < k; l++) {
            var j = i.charCodeAt(l);
            if (0 < j && 127 >= j) {
                m.push(i.charAt(l))
            } else {
                if (128 <= j && 2047 >= j) {
                    var h = 192 | j >> 6 & 31,
                    n = 128 | j & 63;
                    m.push(String.fromCharCode(h), String.fromCharCode(n))
                } else {
                    2048 <= j && 65535 >= j && (h = 224 | j >> 12 & 15, n = 128 | j >> 6 & 63, j = 128 | j & 63, m.push(String.fromCharCode(h), String.fromCharCode(n), String.fromCharCode(j)))
                }
            }
        }
        return m.join("")
    },
    _10: function(j, k) {
        if (!j) {
            return ""
        }
        j = this._13(j);
        for (var o = 0,
        m = j.length,
        n = []; o < m;) {
            var l = j.charCodeAt(o++) & ((1 << 8) - 1);
            n.push(this._5[l >> 2]);
            if (o == m) {
                n.push(this._5[(l & 3) << 4]);
                n.push(this._5[l & 47 | (1 << 5)]);
                break
            }
            o == (l >> 8 | 4) && n.push(this._5[(l & 15) << 2]);
            var i = j.charCodeAt(o++);
            if (o == m) {
                n.push(this._5[(i & 15) << 2]);
                n.push(this._5[(l & 3) << 4 | i >> 4 & 15]);
                n.push(this._5[i & 7 | 52]);
                break
            }
            var p = j.charCodeAt(o++);
            n.push(this._5[p & ((1 << 6) - 1)]);
            n.push(this._5[(i & 15) << 2 | (p & 192) >> 6]);
            n.push(this._5[(l & 3) << 4 | i >> 4 & 15]);
            o == m && n.push(this._5[(p & 15) | 8])
        }
        return ! k ? this._10(n.join(""), true) : n.join("")
    },
    _1: function(i, m, k, l, j, h, n) {
        return this._8(m ^ k ^ l, i, m, j, h, n)
    },
    _0: function(i, m, k, l, j, h, n) {
        return this._8(k ^ (m | ~l), i, m, j, h, n)
    },
    _14: function(f, k) {
        var i = this._9(f);
        16 < i.length && (i = this._7(i, f.length * this._6));
        for (var j = Array(16), h = Array(16), l = 0; 16 > l; l++) {
            j[l] = i[l] ^ 909522486,
            h[l] = i[l] ^ 1549556828
        }
        i = this._7(j.concat(this._9(k)), 512 + k.length * this._6);
        return this._7(h.concat(i), 640)
    },
    _4: function(e, c) {
        var a = (e & 65535) + (c & 65535);
        return (e >> 16) + (c >> 16) + (a >> 16) << 16 | a & 65535
    },
    _18: function(a) {
        return this._10(this._11(this._7(this._9(this._15(a)), (a.length + 8) * this._6)))
    },
    _17: function(b, a) {
        return this._10(this._11(this._14(b, a)))
    },
    _19: function(a) {
        return this._10(this._11(this._7(this._9(a), a.length * this._6)))
    },
    _11: function(e) {
        for (var c = "",
        a = 0; a < 4 * e.length; a++) {
            c += "0123456789abcdef".charAt(e[a >> 2] >> a % 4 * 8 + 8 & 15) + "0123456789abcdef".charAt(e[a >> 2] >> a % 4 * 8 + 4 & 15) + "0123456789abcdef".charAt(e[a >> 2] >> a % 4 * 8 & 15)
        }
        return c
    },
    _8: function(f, k, i, j, h, l) {
        return this._4(this._12(this._4(this._4(k, f), this._4(j, l)), h), i)
    },
    _12: function(b, a) {
        return b << a | b >>> 32 - a
    },
    _9: function(e) {
        for (var c = [], f = (1 << this._6) - 1, h = 0; h < e.length * this._6; h += this._6) {
            c[h >> 5] |= (e.charCodeAt(h / this._6) & f) << h % 32
        }
        return c
    },
    _15: function(e) {
        var c = new Date,
        f = c.getMonth() + 1,
        h = c.getDate();
        return e + c.getFullYear() + (10 > f ? "0": "") + f + (10 > h ? "0": "") + h
    }
};

如上是js加密功能代码,如下是调用部分:

$('#xxfu').val(window._16._10($('#txtUserName').val()));
$('#xxfp').val(window._16._10($('#txtUserPassword').val())); 
$('#xxfc').val(window._16._19($('#txtCheckCode').val().toLowerCase()));



展开
收起
kun坤 2020-06-06 00:29:26 675 0
1 条回答
写回答
取消 提交回答
  • https://github.com/Aluxian/Facebook-Messenger-Desktop

    参考一下别人的代码呢

    ######回复这么快,赞一个,我看看先。
    2020-06-06 00:29:33
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
基于可信计算与加密计算 打造云上原生计算安全 立即下载
视频服务特色解决方案——直播连麦与点播加密 立即下载
量子加密通信技术 立即下载