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

📄 _hill.cpp

📁 这是一个基于HILL密码的加密解密程序 能实现文本信息的加密(密钥可自行设定是一二阶矩阵)
💻 CPP
字号:
// _hill.cpp : implementation file
//

#include "stdafx.h"
#include "hillmima.h"
#include "_hill.h"
#include "hillmimaDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern int Miyao[4];
/////////////////////////////////////////////////////////////////////////////
// C_hill dialog


C_hill::C_hill(CWnd* pParent /*=NULL*/)
	: CDialog(C_hill::IDD, pParent)
{
	//{{AFX_DATA_INIT(C_hill)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void C_hill::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(C_hill)
	DDX_Control(pDX, IDC_EDIT4, m_3);
	DDX_Control(pDX, IDC_EDIT3, m_2);
	DDX_Control(pDX, IDC_EDIT2, m_1);
	DDX_Control(pDX, IDC_EDIT1, m_0);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(C_hill, CDialog)
	//{{AFX_MSG_MAP(C_hill)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// C_hill message handlers

void C_hill::OnButton1() 
{
	// TODO: Add your control notification handler code here
	CString s0,s1,s2,s3;
	m_0.GetWindowText(s0);
	Miyao[0]=atoi(s0);
	m_1.GetWindowText(s1);
	Miyao[1]=atoi(s1);
	m_2.GetWindowText(s2);
	Miyao[2]=atoi(s2);
	m_3.GetWindowText(s3);
	Miyao[3]=atoi(s3);
	if ((Miyao[0]*Miyao[3]-Miyao[1]*Miyao[2])!=1)
	{
		AfxMessageBox("密钥设置不正确,必须其行列式为1!");
	}else
	{
		this->EndDialog(1);
		}
	
}

⌨️ 快捷键说明

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