MCPcopy Create free account
hub / github.com/Semporia/Scripts / decrypt

Function decrypt

jd_cfd.js:1753–1778  ·  view source on GitHub ↗
(time, stk, type, url)

Source from the content-addressed store, hash-verified

1751 })
1752}
1753function decrypt(time, stk, type, url) {
1754 stk = stk || (url ? getUrlData(url, '_stk') : '')
1755 if (stk) {
1756 const timestamp = new Date(time).Format("yyyyMMddhhmmssSSS");
1757 let hash1 = '';
1758 if ($.fingerprint && $.token && $.enCryptMethodJD) {
1759 hash1 = $.enCryptMethodJD($.token, $.fingerprint.toString(), timestamp.toString(), $.appId.toString(), $.CryptoJS).toString($.CryptoJS.enc.Hex);
1760 } else {
1761 const random = '5gkjB6SpmC9s';
1762 $.token = `tk01wcdf61cb3a8nYUtHcmhSUFFCfddDPRvKvYaMjHkxo6Aj7dhzO+GXGFa9nPXfcgT+mULoF1b1YIS1ghvSlbwhE0Xc`;
1763 $.fingerprint = 5287160221454703;
1764 const str = `${$.token}${$.fingerprint}${timestamp}${$.appId}${random}`;
1765 hash1 = $.CryptoJS.SHA512(str, $.token).toString($.CryptoJS.enc.Hex);
1766 }
1767 let st = '';
1768 stk.split(',').map((item, index) => {
1769 st += `${item}:${getUrlData(url, item)}${index === stk.split(',').length -1 ? '' : '&'}`;
1770 })
1771 const hash2 = $.CryptoJS.HmacSHA256(st, hash1.toString()).toString($.CryptoJS.enc.Hex);
1772 // console.log(`\nst:${st}`)
1773 // console.log(`h5st:${["".concat(timestamp.toString()), "".concat(fingerprint.toString()), "".concat($.appId.toString()), "".concat(token), "".concat(hash2)].join(";")}\n`)
1774 return encodeURIComponent(["".concat(timestamp.toString()), "".concat($.fingerprint.toString()), "".concat($.appId.toString()), "".concat($.token), "".concat(hash2), "".concat("3.0"), "".concat(time)].join(";"))
1775 } else {
1776 return '20210318144213808;8277529360925161;10001;tk01w952a1b73a8nU0luMGtBanZTHCgj0KFVwDa4n5pJ95T/5bxO/m54p4MtgVEwKNev1u/BUjrpWAUMZPW0Kz2RWP8v;86054c036fe3bf0991bd9a9da1a8d44dd130c6508602215e50bb1e385326779d'
1777 }
1778}
1779
1780/**
1781 * 获取url参数值

Callers 2

taskUrlFunction · 0.70
taskListUrlFunction · 0.70

Calls 1

getUrlDataFunction · 0.70

Tested by

no test coverage detected