📄 xor.cpp
字号:
// Created:10-21-98
// By Jeff Connelly
// XOR encryption
// Justs XOR the file with the password, simple and fast
// Very weak!
// Used in the ARC archiver
#include "stdafx.h"
#define EXPORTING
#include "comprlib.h"
static void xor_crypt(char* pw);
// Encrypt using XOR
void EXPORT xor_encode(char* pw)
{
xor_crypt(pw);
}
// Decrypt using XOR
void EXPORT xor_decode(char* pw)
{
xor_crypt(pw);
}
// Used for both encryption and decryption
static inline void xor_crypt(char* pw)
{
register char c;
register int i = 0;
register int pwlen = strlen(pw);
while (!end_of_data())
{
c = read_byte();
write_byte(c ^ pw[i % pwlen]);
++i;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -