当前位置:网站首页>js异或混淆代码
js异或混淆代码
2022-06-29 06:41:00 【Liingot】
字符串异或
/**
*
* @param {*} unEncrypted 需要异或的字符串
* @returns
*/
export const strUnicode = (unEncrypted) => {
// 异或混淆
var unicode = "0x75"; //用来异或的key(必须和后台一致,不然后台反异或解不出来)
var encrypted = '';
for (var i = 0; i < unEncrypted.length; i++) {
encrypted += String.fromCharCode(unEncrypted.charCodeAt(i) ^ unicode);
}
return encrypted;
}Byte数组异或
/**
*
* @param {*} unEncrypted Byte数组
* @returns
*/
export const strUnicode = (unEncrypted) => {
let key = "0x75";
let buffer = new ArrayBuffer(16);//Byte数组的length
let uintArr = new Uint8Array(buffer);
for (let i = 0; i < unEncrypted.length; i++) {
uintArr[i] = unEncrypted[i] ^ key;
}
return uintArr;
}边栏推荐
- Detailed explanation of route (Jiuyang Scripture)
- 【量化投资系统】因子处理安装talib
- [translation] swarmed out. Design methods for building modern applications
- 编程能力提升方向
- C实战——高配版贪吃蛇游戏设计
- Perceiving healthy life, enabling boundless connection -- contributing to openharmony 3.1 ecological construction
- Handle series - install spotbugs and use them quickly
- 蓝桥杯——最小框架
- 施努卡:视觉定位系统厂家 什么是视觉定位系统
- 719. 找出第 K 小的数对距离(二分)
猜你喜欢

Swin Transformer理论讲解

VMware vcenter/ESXI系列漏洞总结

Software testing

cv2.cvtColor

What you should know about databases

Matlab Simulink simulation and analysis of power grid sweep frequency

打包时提示: Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘

Wechat applet learning notes (summer vacation)

tf.count_nonzero

手把手系列---安装SpotBugs、并快速上手使用
随机推荐
【深度之眼吴恩达机器学习作业班第四期】Logistic Regression 逻辑回归总结
精选西门子PLC工程实例源码【共300套】
AI与元宇宙擦出火花:人类失去的只有枷锁,获得的是全方面的解放
DataTables screen error Popup
多态中的向上和向下转型
声波通讯 - 流式数据处理 - 窗口对齐
Kyushu cloud helps Inner Mongolia's "counting from the east to the west" project to drive the smart new ecology of the surveying and mapping industry
Roblox剑九之剑二
Appium自动化测试基础 — ADB常用命令(二)
施努卡:3D视觉识别系统 3D视觉检测原理
[FreeRTOS] interrupt mechanism
Detailed explanation of route (Jiuyang Scripture)
Detailed explanation of shell condition judgment
Protobuf 二进制文件学习及解析
SVM,人脸识别遇到的问题及解决方法
蓝桥杯——最小框架
面试官:为什么数据库连接很消耗资源,资源都消耗在哪里?
【工控老马】基于西门子S7-200PLC的跑马灯控制系统的设计方案详解
Vulnhub's dc6 target
Vulnhub's dc9 target