The code is for learning and communication only , Do not use for illegal purposes
import execjs
# Interface key , The code is for learning only , Do not provide exposed signatures
js = '''
function encrypt(t) {
var t = t + "&ct=3&vcode=" + a;
return e.AES.encrypt(t, secret , {
mode: e.mode.ECB,
padding: e.pad.Pkcs7
}).toString();
return t;
}
function decrypt(s) {
var decryptedData = e.AES.decrypt(s, secret , {
mode: e.mode.ECB,
padding: e.pad.Pkcs7
});
return decryptedData.toString(e.enc.Utf8)
}
var e = require("./crypto-js.js"), n = "online", a = "9.7.4";
'''
ctx = execjs.compile(js)
# encryption
encrytedStr = ctx.call("encrypt", '''mod=order&operation=carorder&uid=755312&loginid=7b8cc0c60afa288e87aa8ea2d976c32c&gcount=1&aid=158491&cid=&ginfo=[{"gid":"35171","color":"0","size":"0","count":1,"rec_goods_id":0,"rec_cart_id":0,"referee":0}]&desc=&gdt_vid=&weixinadinfo=&roomId=0&command=&isDeduct=0''')
print(encrytedStr)
# The encrypted value of the above parameter
# ZSCMqvhxmiDQuxKZsWGAoMW+/7kO3mT9dkzkXQCaqKVweMCXnZB9dQu8lt9As8XezGqARe2nzYxO6sYNFTcf+/rCpGgU46HPHrpBxlQkc1HeizBiqmYqT968XD2ble9fVNAXYu/rlUSGl9ATBPQJMr8faKrqoEcd9JgdInbECwSzn7s0b0ahbXq4B6SEdeAHVyb0QsnS1g+ikSvxm8FcAThQWJ+Ag759D31zkDjkK6sPfE3+f2H4/CEFwczPZdpnPSW9ZAaeyj7Dr19vRwDLeaMxe496zTqBQ8fs8H21DMUsr+gDXj/Z9P69vn0CnKuvp23yZTJSPZOqOCSIZqahVw3bgaEuTWKqfP41DvHHp8PJv5Lbgw+yRjYxX8LVlYTO
# Decrypted ciphertext below
# ZSCMqvhxmiDQuxKZsWGAoMW+/7kO3mT9dkzkXQCaqKVweMCXnZB9dQu8lt9As8XezGqARe2nzYxO6sYNFTcf+/rCpGgU46HPHrpBxlQkc1HeizBiqmYqT968XD2ble9fVNAXYu/rlUSGl9ATBPQJMr8faKrqoEcd9JgdInbECwSzn7s0b0ahbXq4B6SEdeAHVyb0QsnS1g+ikSvxm8FcAThQWJ+Ag759D31zkDjkK6sPfE3+f2H4/CEFwczPZdpnPSW9ZAaeyj7Dr19vRwDLeaMxe496zTqBQ8fs8H21DMUsr+gDXj/Z9P69vn0CnKuvp23yZTJSPZOqOCSIZqahVw3bgaEuTWKqfP41DvHHp8PJv5Lbgw+yRjYxX8LVlYTO
# Decrypt
decryptedStr = ctx.call("decrypt", "ZSCMqvhxmiDQuxKZsWGAoMW+/7kO3mT9dkzkXQCaqKVweMCXnZB9dQu8lt9As8XezGqARe2nzYxO6sYNFTcf+/rCpGgU46HPHrpBxlQkc1HeizBiqmYqT968XD2ble9fVNAXYu/rlUSGl9ATBPQJMr8faKrqoEcd9JgdInbECwSzn7s0b0ahbXq4B6SEdeAHVyb0QsnS1g+ikSvxm8FcAThQWJ+Ag759D31zkDjkK6sPfE3+f2H4/CEFwczPZdpnPSW9ZAaeyj7Dr19vRwDLeaMxe496zTqBQ8fs8H21DMUsr+gDXj/Z9P69vn0CnKuvp23yZTJSPZOqOCSIZqahVw3bgaEuTWKqfP41DvHHp8PJv5Lbgw+yRjYxX8LVlYTO")
print(decryptedStr)
from tqsdk import TqApi, TqAut
Hey, everyone, good duck ! Im