blowfish.h

来自「blowfish加密算法的编码类」· C头文件 代码 · 共 31 行

H
31
字号
// Blowfish.h: interface for the CBlowfish class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BLOWFISH_H__B3CA7224_0414_486C_9B4A_987CA54FD1F2__INCLUDED_)
#define AFX_BLOWFISH_H__B3CA7224_0414_486C_9B4A_987CA54FD1F2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define swap(x,y,temp) temp=x;x=y;y=temp;
#define SBOX_BEGIN 18
class CBlowfish  
{
public:
	static const unsigned long pbox[18];
	static const unsigned long sbox[4][256];
	void Blowfish(char* szMessage,char type);
	void BlowfishDe(unsigned long& XL,unsigned long& XR);
	void BlowfishEn(unsigned long& XL,unsigned long& XR);
	void BlowfishKeyInit(const char* szKey,int nStrLen);
	CBlowfish();
	virtual ~CBlowfish();

private:
	unsigned long keybox[1042];
	unsigned long F(const char index[4]);
};

#endif // !defined(AFX_BLOWFISH_H__B3CA7224_0414_486C_9B4A_987CA54FD1F2__INCLUDED_)

⌨️ 快捷键说明

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