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

📄 crijndael.h

📁 1、更正了原来的1.0版本的所有内存泄漏问题。 2、使用了文件读写的缓冲技术
💻 H
字号:
// Rijndael.h: interface for the Rijndael class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_RIJNDAEL_H__B968A9F8_1273_4071_A937_75422FE10718__INCLUDED_)
#define AFX_RIJNDAEL_H__B968A9F8_1273_4071_A937_75422FE10718__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#include <string.h>
#include <stdio.h>

typedef unsigned char byte;

class CRijndael
{
private:
	int Nk,Nr,round;
	long Total_Round,Cur_Round;
	char *SourceFileName,*TargetFileName;
	CString source,*target,save;
	CFile Source,Target;
	byte (* State)[4],*w[4],*key[4];

public:
	CString ErrorMessage;
	CRijndael();
	virtual ~CRijndael();
	bool EncrypFile();
	bool DecrypFile();
	CString DecrypStr();
	CString EncrypStr();
	bool SetFileName(CString SFileName,CString TFileName);
	bool SetString(CString sour,CString &targ);
	bool SetVariable(int k,int r,CString skey);
	int GetCurPos();

private:
	void SubBytes();
	void ShiftRows();
	void MixColumns();
	byte Multi(byte a,byte b);
	void AddRoundKey();
	void KeyExpansion();
	void InvShiftRows();
	void InvSubBytes();
	void InvMixColumns();
	void Encryption();
	void Decryption();
};

#endif // !defined(AFX_RIJNDAEL_H__B968A9F8_1273_4071_A937_75422FE10718__INCLUDED_)

⌨️ 快捷键说明

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