当前位置:网站首页>JS XOR obfuscation code
JS XOR obfuscation code
2022-06-29 07:53:00 【Liingot】
String XOR
/**
*
* @param {*} unEncrypted A string that requires exclusive or
* @returns
*/
export const strUnicode = (unEncrypted) => {
// XOR confusion
var unicode = "0x75"; // Used for exclusive or key( Must be consistent with the background , Otherwise, the backstage anti XOR cannot be solved )
var encrypted = '';
for (var i = 0; i < unEncrypted.length; i++) {
encrypted += String.fromCharCode(unEncrypted.charCodeAt(i) ^ unicode);
}
return encrypted;
}Byte Array XOR
/**
*
* @param {*} unEncrypted Byte Array
* @returns
*/
export const strUnicode = (unEncrypted) => {
let key = "0x75";
let buffer = new ArrayBuffer(16);//Byte Array of length
let uintArr = new Uint8Array(buffer);
for (let i = 0; i < unEncrypted.length; i++) {
uintArr[i] = unEncrypted[i] ^ key;
}
return uintArr;
}边栏推荐
- 100 lectures on Excel advanced drawing skills (VI) - practical application cases of Gantt chart in project progress
- Interviewer: why does database connection consume resources? Where are the resources consumed?
- Software testing
- SAP ui5 Beginner (I) Introduction
- 【工控老马】西门子PLC s7-300SCL编程详解
- 从Nacos客户端谈Nacos配置中心
- tf. count_ nonzero
- Detailed explanation of shell condition judgment
- 498. 对角线遍历(模拟)
- VMware vcenter/ESXI系列漏洞总结
猜你喜欢

呕心沥血总结出来的MySQL常见错误以及解决方法(一)

postman预处理/前置条件Pre-request

互联网公司的组织结构与产品经理岗位职责是什么?

VSLAM特征之线特征&面特征

Problem solving -- > online OJ (13)

产品经理应该学习墨刀还是Axure?

Reasons why the ext.dic file configured in ES does not take effect

Postman pre request

tf. count_ nonzero

Common MySQL errors and solutions summarized painstakingly (I)
随机推荐
Vulnhub's dc6 target
tf. count_ nonzero
SQL 注入绕过(六)
呕心沥血总结出来的MySQL常见错误以及解决方法(二)
【工控老马】单片机与西门子S7-200通信原理详解
Prompt during packaging: property 'sqlsessionfactory' or 'sqlsessiontemplate'‘
Using cdockablepane to realize floating window in MFC
qtcreator设置字符集
Fluent imitates uiswitch
Oracle 批量插入数据-插入民族数据
反思 - 完美主义
手撕二叉搜索树(Binary Search Tree)
jsp学习部分
Software testing
AI与元宇宙擦出火花:人类失去的只有枷锁,获得的是全方面的解放
SQL Server 开启cdc
【工控老马】洗衣机PLC程序控制系统设计详解
Appium automation test foundation ADB common commands (II)
[industrial control old horse] detailed explanation of design principle of pattern fountain based on PLC
Kingbasees v8r6 cluster maintenance case - data migration between clusters