Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
|
6b0155cdea | 7 months ago |
|
a24a20fcae | 7 months ago |
54 changed files with 6462 additions and 875 deletions
@ -1,27 +0,0 @@ |
|||||||
const express = require("express"); |
|
||||||
const router = express.Router(); |
|
||||||
let UUIDUtil = require("../utils/UUIDUtil"); |
|
||||||
|
|
||||||
const HunanService = require("./service/HunanService"); |
|
||||||
|
|
||||||
|
|
||||||
hunanService = new HunanService() |
|
||||||
|
|
||||||
router.post('/getMMCookie', (req, res) => { |
|
||||||
let uuid = UUIDUtil.uuid; |
|
||||||
let key = req.body.key |
|
||||||
let str = req.body.str |
|
||||||
let start = new Date(); |
|
||||||
try { |
|
||||||
// 执行
|
|
||||||
let response = hunanService.aes_MM_cookie(key, str); |
|
||||||
return res.status(200).send(response); |
|
||||||
} catch (e) { |
|
||||||
console.error(e.stack) |
|
||||||
return res.status(500).send(e.message) |
|
||||||
} finally { |
|
||||||
console.log(`${uuid};getMMCookie ${new Date() - start} ms`) |
|
||||||
} |
|
||||||
}) |
|
||||||
|
|
||||||
module.exports = router |
|
@ -1,15 +0,0 @@ |
|||||||
const CryptoJS = require('crypto-js'); |
|
||||||
const {jsdomFromText, browser} = require("sdenv"); |
|
||||||
const {Script} = require("node:vm"); |
|
||||||
const fs = require("node:fs"); |
|
||||||
const path = require("node:path"); |
|
||||||
|
|
||||||
const {aes_encrypt} = require("./static/hunan_MM_mq4qQammP3BAe_cookie"); |
|
||||||
|
|
||||||
class HunanService { |
|
||||||
aes_MM_cookie(key, str) { |
|
||||||
return aes_encrypt(key, str) |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
module.exports = HunanService |
|
File diff suppressed because one or more lines are too long
@ -1,34 +0,0 @@ |
|||||||
const aesJs = require('aes-js'); |
|
||||||
|
|
||||||
|
|
||||||
function _0x2925ac(x) { |
|
||||||
var c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; |
|
||||||
var e = ""; |
|
||||||
for (var W = 0; W < x; W++) { |
|
||||||
e += c.charAt(Math.random(0, 62)); |
|
||||||
} |
|
||||||
return e |
|
||||||
} |
|
||||||
|
|
||||||
function _0x5178e5(x) { |
|
||||||
let _ = ""; |
|
||||||
for (let d = 0; d < x.length; d++) { |
|
||||||
_ += String["fromCharCode"](x[d]); |
|
||||||
} |
|
||||||
return _ |
|
||||||
} |
|
||||||
|
|
||||||
function aes_encrypt(key, str) { |
|
||||||
let a = aesJs["utils"]["utf8"]["toBytes"](key) |
|
||||||
, f = _0x2925ac(16) |
|
||||||
, n = aesJs["utils"]["utf8"]["toBytes"](f) |
|
||||||
, t = aesJs["utils"]["utf8"]["toBytes"](str); |
|
||||||
t = aesJs.padding.pkcs7.pad(t); |
|
||||||
const r = new aesJs.ModeOfOperation.cbc(a, n).encrypt(t); |
|
||||||
const b = new Uint8Array(n["length"] + t["length"]); |
|
||||||
b["set"](n, 0); |
|
||||||
b["set"](r, 16); |
|
||||||
return btoa(_0x5178e5(b)) |
|
||||||
} |
|
||||||
|
|
||||||
module.exports = {aes_encrypt} |
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue