📄 crijndael.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 + -