点这里
在线加密解密工具
js写法:
function decrypt(test) {
var key = [3, 9, 4, 9, 0, 5];//密钥
if (typeof key == 'number') key = [key];
let output = '';
for (var i = 0; i < test.length; i++) {
const c = test[i].charCodeAt();
const k = key[i % key.length];
output += String.fromCharCode(c ^ k);
}
return output;
}
decrypt('123456abc')
//打印结果 '2;7=53bkg'
工具测试结果图:

这是一个使用JavaScript编写的在线加密解密工具的示例代码。函数decrypt通过密钥对输入字符串进行异或操作实现解密,输出解密后的字符串。该工具有助于理解简单的字符加密原理。

287

被折叠的 条评论
为什么被折叠?



