crijndael.h

来自「DES加解密 AES(使用了文件读写的缓冲和多线程技术)」· C头文件 代码 · 共 56 行

H
56
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?