某某某某招某某某 网站js登录加密方式。

1.135 分析后为AES加密。

加密流程

const CryptoJS = require('crypto-js');  //引用AES源码js

const e = JSON.parse('{"data":{"password":"123456"},"key":"pigxpigxpigxpigx","param":["password"]}')
const o = CryptoJS;
let t = e.data
let n = e.type
let r = e.param
let a = e.key
let i = JSON.parse(JSON.stringify(t));
r.forEach(function (e) {
    var t = i[e];
    key = o["enc"].Latin1.parse(a);
    var n = key
        , r = o["AES"].encrypt(t, key, {
        iv: n,
        mode: o["mode"].CBC,
        padding: o["pad"].ZeroPadding
    });
    let enc_password = r.toString();
    console.log(enc_password)
    i[e] = enc_password
})

解密流程

const CryptoJS = require('crypto-js');  //引用AES源码js

const e = JSON.parse('{"data":{"password":"123456"},"key":"pigxpigxpigxpigx","param":["password"]}')
const o = CryptoJS;
let t = e.data
let n = e.type
let r = e.param
let a = e.key
let i = JSON.parse(JSON.stringify(t));
const enc = "rKu1/348LvKp0rsVC06eCA=="
r.forEach(function (e) {
    var t = i[e];
    key = o["enc"].Latin1.parse(a);
    var n = key
    let r = o["AES"].decrypt(enc, key, {
        iv: n,
        mode: o["mode"].CBC,
        padding: o["pad"].ZeroPadding
    });
    console.log(r.toString(CryptoJS.enc.Utf8))
})

posted @ 2022-10-21 21:25  wgf4242  阅读(52)  评论(0编辑  收藏  举报