本代码没有运用现成的NTL库实现RSA加密、解密运算。而是采用了RSA算法的基本算法思想实现而成。
源代码在线查看: rsa加密算法dlg.h
// RSA加密算法Dlg.h : header file
//
#if !defined(AFX_RSADLG_H__4C150B6F_BEE2_4EDF_90F0_55E05035C074__INCLUDED_)
#define AFX_RSADLG_H__4C150B6F_BEE2_4EDF_90F0_55E05035C074__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CRSADlg dialog
class CRSADlg : public CDialog
{
// Construction
public:
CRSADlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CRSADlg)
enum { IDD = IDD_RSA_DIALOG };
CString m_bignum1;
CString m_bignum2;
CString m_gongyao;
CString m_siyao;
CString m_mingwen;
CString m_asc;
CString m_miwen;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CRSADlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CRSADlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnMingToAsc();
afx_msg void OnAscToMing();
afx_msg void OnEncrpyt();
virtual void OnCancel();
afx_msg void Ondecrypt();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RSADLG_H__4C150B6F_BEE2_4EDF_90F0_55E05035C074__INCLUDED_)