?? 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 + -