15 lines
		
	
	
		
			329 B
		
	
	
	
		
			C++
		
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			329 B
		
	
	
	
		
			C++
		
	
	
	
| #pragma once
 | |
| #include "pch.h"
 | |
| 
 | |
| 
 | |
| //单个字符解密
 | |
| char CutcodeChar(char c, int key, int key2) {
 | |
|     return (((c - 1) ^ key) ^ key2) - key;
 | |
| }
 | |
| 
 | |
| //解密
 | |
| void Cutecode(char* pstr, int* pkey) {
 | |
|     int len = strlen(pstr);
 | |
|     for (int i = 0; i < len; i++)
 | |
|         *(pstr + i) = CutcodeChar(*(pstr + i), pkey[i % 5], pkey[(i + 18) % 5]);
 | |
| } |