addHeaders(); //添加头部请求 $plaintext = $_POST['txt']; $miwen = $_POST['miwen']; $key = "6969"; //加密 $encrypted = base64_encode(openssl_encrypt($plaintext, 'aes-256-ecb', "6969", OPENSSL_RAW_DATA)); //解密 $decrypted = openssl_decrypt(base64_decode($miwen), 'aes-256-ecb', $key, OPENSSL_RAW_DATA); $data['code'] = '200'; $data['message'] = 'ok'; $data['data'] = $encrypted; $data['jiemi'] = $decrypted; echo json_encode($data); } public function encoding_t() { $this->addHeaders(); //添加头部请求 $rs = array( ); $url1["id"] = 23; $url1["url"] = base64_encode(openssl_encrypt("https://abc444.w3pei0uemtnewqiomhkeahhu.app", 'aes-256-ecb', "6969", OPENSSL_RAW_DATA)); $url1["type"] = "付费资源"; $url2["id"] = 24; $url2["url"] = base64_encode(openssl_encrypt("https://abc66.w3pei0uemtnewqiomhkeahhu.app", 'aes-256-ecb', "6969", OPENSSL_RAW_DATA)); $url2["type"] = "付费资源"; $rs[0][0]=$url1; $rs[0][1]=$url2; $url3["id"] = 27; $url3["url"] = base64_encode(openssl_encrypt("https://abc88.w3pei0uemtnewqiomhkeahhu.app", 'aes-256-ecb', "6969", OPENSSL_RAW_DATA)); $url3["type"] = "免费资源"; $url4["id"] = 30; $url4["url"] = base64_encode(openssl_encrypt("https://abc111.w3pei0uemtnewqiomhkeahhu.app", 'aes-256-ecb', "6969", OPENSSL_RAW_DATA)); $url4["type"] = "免费资源"; $url5["id"] = 33; $url5["url"] = base64_encode(openssl_encrypt("https://abc333.w3pei0uemtnewqiomhkeahhu.app", 'aes-256-ecb', "6969", OPENSSL_RAW_DATA)); $url5["type"] = "免费资源"; $rs[1][0]=$url3; $rs[1][1]=$url4; $rs[1][5]=$url5; $url6["id"] = 34; $url6["url"] = base64_encode(openssl_encrypt("https://qsd6.pndgd5dti4zth3dthkcxvpzgppm2rjzndy.xyz", 'aes-256-ecb', "6969", OPENSSL_RAW_DATA)); $url6["type"] = "吃瓜"; $url7["id"] = 35; $url7["url"] = base64_encode(openssl_encrypt("https://qsd5.pndgd5dti4zth3dthkcxvpzgppm2rjzndy.xyz", 'aes-256-ecb', "6969", OPENSSL_RAW_DATA)); $url7["type"] = "吃瓜"; $rs[2][0]=$url6; $rs[2][1]=$url7; $data['code'] = '200'; $data['message'] = 'ok'; $data['data'] = $rs; echo json_encode($data); } }