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

📄 code.cpp

📁 加密和解密 sdfasfasdfsdfd
💻 CPP
字号:
#include <cstring>
#include <atlstr.h>
#include <Windows.h>
#include <string>
#include <iostream>
//__declspec(dllexport) LPCTSTR
using namespace std;
__declspec(dllexport) LPCTSTR __stdcall encode(LPCTSTR ss)
{
	CString s=ss;
	WORD Key=24352;//密钥
	CString str,str1,result;
	int i,j;
	str=s;
	for (i=0;i<s.GetLength();i++)
	{
		str.SetAt(i,s.GetAt(i)+Key);
	}
	s=str;
	for (i=0;i<s.GetLength();i++)
	{
		j=(BYTE)s.GetAt(i);
		str1="01";
		str1.SetAt(0,65+j/26);
		str1.SetAt(1,65+j%26);
		result+=str1;

	}
	return (LPCTSTR)result;


}
__declspec(dllexport) LPCTSTR __stdcall decode(LPCTSTR ss)
{
	CString s=(CString)ss;
	WORD key=24352;//密钥
	CString result,str;
	int i,j;
	for (i=0;i<s.GetLength()/2;i++)
	{
		j=((BYTE)s.GetAt(2*i)-65)*26;
		j+=(BYTE)s.GetAt(2*i+1)-65;
		str="0";
		str.SetAt(0,j);
		result+=str;
	}
	s=result; 
	for (i=0;i<s.GetLength();i++)
	{
		result.SetAt(i,(BYTE)s.GetAt(i)-key);
	}
	return (LPCTSTR)result;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -