mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-20 03:59:57 +08:00
60js加密轻混url加密-AES
This commit is contained in:
parent
fcb746b36f
commit
86394ed812
@ -1,23 +1,33 @@
|
|||||||
const CryptoJS = require("crypto-js");
|
const CryptoJS = require("crypto-js");
|
||||||
|
|
||||||
let value = "5"; //待加密的字符串
|
|
||||||
let secret_value = "aiding88";
|
|
||||||
|
|
||||||
// 密匙和向量处理
|
function L(j) {
|
||||||
let secret = CryptoJS.enc.Utf8.parse(secret_value);
|
var I = '2|3|0|4|1'['split']('|')
|
||||||
|
, J = 0xd * -0x4 + 0x1f35 * -0x1 + -0x2db * -0xb;
|
||||||
// 加密
|
while (!![]) {
|
||||||
let encrypted = CryptoJS.AES.encrypt(value, secret, {
|
switch (I[J++]) {
|
||||||
// mode 支持 CBC, CFB,CTB,ECB,OFB,OFB, 默认CBC
|
case '0':
|
||||||
mode: CryptoJS.mode.ECB,
|
var d = Y['enc']['Utf8']['parse'](S);
|
||||||
|
continue;
|
||||||
// NoPadding, zeropadding 默认Pkcs7 即 pkcs5
|
case '1':
|
||||||
padding: CryptoJS.pad.Pkcs7
|
return D['toString']();
|
||||||
|
case '2':
|
||||||
|
var Y = CryptoJS;
|
||||||
|
continue;
|
||||||
|
case '3':
|
||||||
|
var S = 'aiding88';
|
||||||
|
continue;
|
||||||
|
case '4':
|
||||||
|
var D = Y['AES']['encrypt'](j, d, {
|
||||||
|
'mode': Y['mode']['ECB'],
|
||||||
|
'padding': Y['pad']['Pkcs7']
|
||||||
});
|
});
|
||||||
|
console.log(D);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 将加密结果转换为字符串
|
|
||||||
encrypted = encrypted.toString();
|
|
||||||
|
|
||||||
console.log(secret);
|
console.log(L('1'));
|
||||||
console.log(value);
|
|
||||||
console.log(encrypted);
|
|
@ -6,6 +6,7 @@ def challenge60(page, encrypted_text):
|
|||||||
url = f"https://www.python-spider.com/api/challenge60/{encrypted_text}"
|
url = f"https://www.python-spider.com/api/challenge60/{encrypted_text}"
|
||||||
print(url)
|
print(url)
|
||||||
payload = f"page={page}"
|
payload = f"page={page}"
|
||||||
|
print(payload)
|
||||||
session = requests.session()
|
session = requests.session()
|
||||||
headers = {
|
headers = {
|
||||||
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
||||||
@ -17,14 +18,12 @@ def challenge60(page, encrypted_text):
|
|||||||
|
|
||||||
def run():
|
def run():
|
||||||
data_num = 0
|
data_num = 0
|
||||||
for page in range(5, 101):
|
for page in range(1, 101):
|
||||||
print('aiding88', str(page))
|
|
||||||
encrypted_text = encrypt('aiding88', str(page))
|
encrypted_text = encrypt('aiding88', str(page))
|
||||||
print(encrypted_text)
|
|
||||||
response_json = challenge60(page, encrypted_text)
|
response_json = challenge60(page, encrypted_text)
|
||||||
data_list = response_json.get('data')
|
print(response_json)
|
||||||
print(data_list)
|
|
||||||
exit()
|
exit()
|
||||||
|
data_list = response_json.get('data')
|
||||||
for data in data_list:
|
for data in data_list:
|
||||||
data_num += int(data.get('value'))
|
data_num += int(data.get('value'))
|
||||||
print(data_num)
|
print(data_num)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user