⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xor.cpp

📁 非常好用的五子棋游戏源码
💻 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 + -