MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / decryptByAppKey

Function decryptByAppKey

wxapp/hisense_aijia.js:142–151  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

140}
141
142function decryptByAppKey(value) {
143 if (!value) return "";
144 try {
145 const secret = getSignSecret(SIGN_APP_KEY);
146 const decipher = crypto.createDecipheriv("aes-256-cbc", Buffer.from(secret, "utf8"), Buffer.from(secret.slice(0, 16), "utf8"));
147 return Buffer.concat([decipher.update(String(value), "base64"), decipher.final()]).toString("utf8");
148 } catch {
149 return value;
150 }
151}
152
153function cleanPayload(data = {}) {
154 return Object.entries(data).reduce((obj, [key, val]) => {

Callers 1

queryProfileMethod · 0.85

Calls 1

getSignSecretFunction · 0.85

Tested by

no test coverage detected