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

📄 des_cipher.h

📁 这是我编的包括古典密码
💻 H
字号:
#if !defined(AFX_DES_CIPHER_H__8AFB9DED_7CEB_4EF7_ABCA_A0B03F202DB1__INCLUDED_)
#define AFX_DES_CIPHER_H__8AFB9DED_7CEB_4EF7_ABCA_A0B03F202DB1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DES_Cipher.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CDES_Cipher dialog

class CDES_Cipher : public CDialog
{
// Construction
public:
	int * IPAPlace (int *CipherArray, int *RL, int *LL);
	BOOL ManageCiphertext(CString Ciphertext);
	CString ManagePlaintext(CString Plaintext, int digit);
	int m_CipherArray[64];
	BOOL ProduceKey();
	CString ProducePlain (CString Plaintext, int *CipherArray);
	void ProduceIntArray (int *IntKeyWord, CString Plaintext);
	void EvaluateArray (int *ArrayL, int *ArrayR, int length);
	CString ProduceCipher (CString Ciphertext, int *m_plain);
	int * ProduceAKey (int * C, int *D, int digit);
	int * PC2Rplacement (int *C, int *D);
	int * CycLeft (int *Array, int length, int digit);
	void DistillCAndD (int *KeyWord,int length);
	int * PBoxArange (int *SBoxOut,int length);
	int m_SBoxOut[32];
	int * SBoxSelection (int *SBoxOut, int *ExpandPlain, int length);
	void Init_SBox ();
	void Innit_PBox ();
	int * FFunction (int *m_plain, int *KeyArray);
	int * XOROperation (int * ArrayL, int * ArrayR, int length);
	int * ExpandManagement (int * m_plain);
	void Init_PlaceIP (int *m_plain);
	void Init_IP ();
	void Init_PC ();
	void Trans_Dialog(CWnd *temp);
	CDES_Cipher(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CDES_Cipher)
	enum { IDD = IDD_DES_CIPHER };
	CString	m_strKeyWord;
	CString m_strHint;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDES_Cipher)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CDES_Cipher)
	afx_msg void OnEncipher();
	afx_msg void OnDecipher();
	afx_msg void OnHelp();
	afx_msg void OnQuit();
	afx_msg void OnEvaluate();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	int sign;
	int m_D[28];
	int m_C[28];
	int m_PBoxOut[32];
	CString m_Ciphertext;
	CString m_Plaintext;
	int PC2[48];
	int PC1[56];
	int IP[64];
	int IPA[64];
	int m_Plain[64];
	int m_IntKeyWord[64];
	int Key[48];
	int m_Key[16][48];
	int L[32];
	int R[32];
	int m_ExpandPlain [48];
	int SBox[8][4][16];
	int PBox[32];
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DES_CIPHER_H__8AFB9DED_7CEB_4EF7_ABCA_A0B03F202DB1__INCLUDED_)

⌨️ 快捷键说明

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