CKryptosDlg Class Reference

#include <KryptosDlg.h>

List of all members.

Public Types

enum  { IDD = IDD_KRYPTOS_DIALOG }

Public Member Functions

 CKryptosDlg (CWnd *pParent=NULL, CSplashFactory *splashFactory=NULL)
bool FixedParameters (int algorithm)
virtual BOOL PreTranslateMessage (MSG *pMsg)
virtual BOOL DestroyWindow ()
void FormatCycles (CString &s)
void HideRight ()
void CleanLeft ()
afx_msg void OnEnChangeTnwDialogCpuTime ()

Public Attributes

int DIRECTION
CSplashFactorym_pSplashFactory
CMenu m_menu
CEdit m_ProgressBar2
CFont m_Font
CAlgorithmSheet * p_AlgorithmSheet
CCryptoLinkm_CryptoLink
int sheet_size
CBrush m_BrushBlue
COLORREF m_Blue
CString m_programTitle
CString m_CPU_time
CString m_CPU_cycles
CString m_CPU_cycles1
CString m_CPU_time1

Protected Member Functions

virtual void DoDataExchange (CDataExchange *pDX)
virtual BOOL OnInitDialog ()
afx_msg void OnSysCommand (UINT nID, LPARAM lParam)
afx_msg void OnDestroy ()
afx_msg void OnPaint ()
afx_msg BOOL OnEraseBkgnd (CDC *pDC)
afx_msg HCURSOR OnQueryDragIcon ()
afx_msg void OnUpdateStatusSend (CCmdUI *pCmdUI)
afx_msg void OnUpdateStatusRec (CCmdUI *pCmdUI)
afx_msg void OnUpdateOperationEnc (CCmdUI *pCmdUI)
afx_msg void OnUpdateOperationDec (CCmdUI *pCmdUI)
afx_msg void OnUpdateOperationSign (CCmdUI *pCmdUI)
afx_msg void OnUpdateOperationVer (CCmdUI *pCmdUI)
afx_msg void OnUpdateOperationHash (CCmdUI *pCmdUI)
afx_msg void OnUpdateOperationPkEnc (CCmdUI *pCmdUI)
afx_msg void OnUpdateOperationPkDec (CCmdUI *pCmdUI)
afx_msg void OnUpdateOperationMacGen (CCmdUI *pCmdUI)
afx_msg void OnUpdateOperationMacVer (CCmdUI *pCmdUI)
afx_msg void OnAlgorithmSetAlg ()
afx_msg void OnUpdateAlgorithmSetAlg (CCmdUI *pCmdUI)
afx_msg void OnAlgorithmparametersSetAlgPara ()
afx_msg void OnUpdateAlgorithmparametersSetAlgPara (CCmdUI *pCmdUI)
afx_msg void OnUpdateModeSetMode (CCmdUI *pCmdUI)
afx_msg void OnModeSetMode ()
afx_msg void OnUpdateInputoutputChoosefileio (CCmdUI *pCmdUI)
afx_msg void OnInputoutputChoosefileio ()
virtual void OnOK ()
virtual void OnCancel ()
afx_msg void OnStatusExit ()
afx_msg void OnHelpAbout ()
afx_msg HBRUSH OnCtlColor (CDC *pDC, CWnd *pWnd, UINT nCtlColor)
afx_msg void OnSetfocusTnwDialogStatus ()
afx_msg void OnKillFocus (CWnd *pNewWnd)
afx_msg void OnStatusSend ()
afx_msg void OnStatusRec ()
afx_msg void OnOperationEnc ()
afx_msg void OnOperationDec ()
afx_msg void OnOperationPkEnc ()
afx_msg void OnOperationPkDec ()
afx_msg void OnOperationSign ()
afx_msg void OnOperationVer ()
afx_msg void OnOperationHash ()
afx_msg void OnOperationMacGen ()
afx_msg void OnOperationMacVer ()
afx_msg void OnTnwDialogButtonTransform ()
afx_msg void OnTimer (UINT nIDEvent)
afx_msg void OnKeyGeneratekey ()
afx_msg void OnUpdateKeyGeneratekey (CCmdUI *pCmdUI)
afx_msg void OnButton1 ()
afx_msg void OnUpdateOperationHashVer (CCmdUI *pCmdUI)
afx_msg void OnOperationHashVer ()
afx_msg void OnTiming ()
afx_msg void OnLibSet ()

Protected Attributes

HICON m_hIcon
double m_CPU_frequency
double m_CPU_avg_dev


Detailed Description

This class is the meat of Kryptos. It handles all user events and calls the cryptographic libraries when the user hits "Go".s


Member Enumeration Documentation

anonymous enum

Sets the dialog id

Enumerator:
IDD 


Constructor & Destructor Documentation

CKryptosDlg::CKryptosDlg ( CWnd *  pParent = NULL,
CSplashFactory splashFactory = NULL 
)

The constructor for Kryptos and initializes all of the member attributes.

Parameters:
pParent - a CWnd pointer that is NULL for this dialog.
splashFactory - points to the splash implementation for Kryptos


Member Function Documentation

bool CKryptosDlg::FixedParameters ( int  algorithm  ) 

Sets parameters for those algorithms whose parameters are fixed. Returns true if the algorithm's parameters are fixed, returns false if algorithm parameters can be chosen from multiple options.

Parameters:
algorithm - an int representing the chosen algorithm
Returns:
true if the algorithm is DES or IDEA, false otherwise.

BOOL CKryptosDlg::PreTranslateMessage ( MSG *  pMsg  )  [virtual]

Calls the parent implementation of PreTranslateMessage

BOOL CKryptosDlg::DestroyWindow (  )  [virtual]

void CKryptosDlg::DoDataExchange ( CDataExchange *  pDX  )  [protected, virtual]

void CKryptosDlg::FormatCycles ( CString &  s  ) 

Adds commas to the CPU cycles for readability. s - a reference to a CString that holds the number of cycles it took to perform an operation.

void CKryptosDlg::HideRight (  ) 

Hides portions of the dialog that are no longer active

void CKryptosDlg::CleanLeft (  ) 

virtual BOOL CKryptosDlg::OnInitDialog (  )  [protected, virtual]

void CKryptosDlg::OnSysCommand ( UINT  nID,
LPARAM  lParam 
) [protected]

void CKryptosDlg::OnDestroy (  )  [protected]

void CKryptosDlg::OnPaint (  )  [protected]

BOOL CKryptosDlg::OnEraseBkgnd ( CDC *  pDC  )  [protected]

HCURSOR CKryptosDlg::OnQueryDragIcon (  )  [protected]

void CKryptosDlg::OnUpdateStatusSend ( CCmdUI *  pCmdUI  )  [protected]

Called when the user selects "Sender" as the status. It initializes the appropriate menu items for a sender based on the library implementation chosen.

void CKryptosDlg::OnUpdateStatusRec ( CCmdUI *  pCmdUI  )  [protected]

Sets the appropriate menus and options when the user sets Kryptos to receiver mode.

void CKryptosDlg::OnUpdateOperationEnc ( CCmdUI *  pCmdUI  )  [protected]

Sets up the menu options when the user indicates encryption.

void CKryptosDlg::OnUpdateOperationDec ( CCmdUI *  pCmdUI  )  [protected]

Initializes decryption settings.

void CKryptosDlg::OnUpdateOperationSign ( CCmdUI *  pCmdUI  )  [protected]

Sets Kryptos up for PK signature generation

void CKryptosDlg::OnUpdateOperationVer ( CCmdUI *  pCmdUI  )  [protected]

Sets Kryptos up for verification

void CKryptosDlg::OnUpdateOperationHash ( CCmdUI *  pCmdUI  )  [protected]

Sets Kryptos up for generating a hash

void CKryptosDlg::OnUpdateOperationPkEnc ( CCmdUI *  pCmdUI  )  [protected]

Sets up Kryptos for PK encryption

void CKryptosDlg::OnUpdateOperationPkDec ( CCmdUI *  pCmdUI  )  [protected]

Sets Kryptos up for PK decryption

void CKryptosDlg::OnUpdateOperationMacGen ( CCmdUI *  pCmdUI  )  [protected]

Sets Kryptos up for MAC generation

void CKryptosDlg::OnUpdateOperationMacVer ( CCmdUI *  pCmdUI  )  [protected]

Sets Kryptos up for MAC Verification

void CKryptosDlg::OnAlgorithmSetAlg (  )  [protected]

Create property pages when the user selects Menu: SetAlgorithm. This page is determined based on the DIRECTION member which tells Kryptos what function we're performing.

void CKryptosDlg::OnUpdateAlgorithmSetAlg ( CCmdUI *  pCmdUI  )  [protected]

Redraws the menu bar Kryptos when the user has chosen an algorithm

void CKryptosDlg::OnAlgorithmparametersSetAlgPara (  )  [protected]

Create property pages for Menu: SetAlgorithm Parameters based on DIRECTION

void CKryptosDlg::OnUpdateAlgorithmparametersSetAlgPara ( CCmdUI *  pCmdUI  )  [protected]

Sets the next menu up after the user hash chosen algorithm parameters

void CKryptosDlg::OnUpdateModeSetMode ( CCmdUI *  pCmdUI  )  [protected]

Callback function for Menu item mode

void CKryptosDlg::OnModeSetMode (  )  [protected]

Create propertypages for Menu item Mode based on DIRECTION

void CKryptosDlg::OnUpdateInputoutputChoosefileio ( CCmdUI *  pCmdUI  )  [protected]

Menu Input/Output

void CKryptosDlg::OnInputoutputChoosefileio (  )  [protected]

Called when the user hash chosen files to operate with

void CKryptosDlg::OnOK (  )  [protected, virtual]

Does nothing

void CKryptosDlg::OnCancel (  )  [protected, virtual]

Calls the parent implementation of OnCancel

void CKryptosDlg::OnStatusExit (  )  [protected]

Calls EndDialog

void CKryptosDlg::OnHelpAbout (  )  [protected]

Calls the about dialog.

HBRUSH CKryptosDlg::OnCtlColor ( CDC *  pDC,
CWnd *  pWnd,
UINT  nCtlColor 
) [protected]

Performs color-related actions.

void CKryptosDlg::OnSetfocusTnwDialogStatus (  )  [protected]

Does nothing

void CKryptosDlg::OnKillFocus ( CWnd *  pNewWnd  )  [protected]

Calls parent implementation of OnKillFocus

void CKryptosDlg::OnStatusSend (  )  [protected]

Called when the user first selects the "Sender" menu option.

void CKryptosDlg::OnStatusRec (  )  [protected]

Sets window text to Receiver when the user selected "Receiver"

void CKryptosDlg::OnOperationEnc (  )  [protected]

Sets the window text to "Encryption"

void CKryptosDlg::OnOperationDec (  )  [protected]

Sets window text to "Decryption"

void CKryptosDlg::OnOperationPkEnc (  )  [protected]

Sets window text to "Public key encryption"

void CKryptosDlg::OnOperationPkDec (  )  [protected]

Sets window text to "Public key decryption"

void CKryptosDlg::OnOperationSign (  )  [protected]

Sets window text to "Signature generation"

void CKryptosDlg::OnOperationVer (  )  [protected]

Sets window text to "Signature verification"

void CKryptosDlg::OnOperationHash (  )  [protected]

Sets the window text to "Hash"

void CKryptosDlg::OnOperationMacGen (  )  [protected]

Sets the window text to "MAC generation"

void CKryptosDlg::OnOperationMacVer (  )  [protected]

Sets the window text to "MAC Verification"

void CKryptosDlg::OnTnwDialogButtonTransform (  )  [protected]

Function for transform. This is called when the 'GO' button on the main Kryptos window is pushed.

void CKryptosDlg::OnTimer ( UINT  nIDEvent  )  [protected]

Calls parent implementation of OnTimer

void CKryptosDlg::OnKeyGeneratekey (  )  [protected]

Create propertypages for Menu key, Menu item Generate key based on DIRECTION

...and empty the path strings

void CKryptosDlg::OnUpdateKeyGeneratekey ( CCmdUI *  pCmdUI  )  [protected]

Callback after Generating the Key

void CKryptosDlg::OnButton1 (  )  [protected]

Shows key details in a window

void CKryptosDlg::OnUpdateOperationHashVer ( CCmdUI *  pCmdUI  )  [protected]

Updates the follow-on menus when the user hash chosen hash verification

void CKryptosDlg::OnOperationHashVer (  )  [protected]

Updates window text to "Hash verifiy"

void CKryptosDlg::OnTiming (  )  [protected]

Shows timing details

void CKryptosDlg::OnLibSet (  )  [protected]

Called when the user has selected a library. This function will create a CCryptoPPLink class if Crypto++ was selected or a COpenSSLLink class if OpenSSL was selected. If the m_CryptoLink pointer was not null, it will delete the previously chosen class and free memory.

This function will also ungray the "Status" menu for the next step.

void CKryptosDlg::OnEnChangeTnwDialogCpuTime (  ) 

Does nothing


Member Data Documentation

int CKryptosDlg::DIRECTION

Indicates whether the user wants Kryptos to act as sender or receiver

CSplashFactory* CKryptosDlg::m_pSplashFactory

Points to the Splash screen implementation

CMenu CKryptosDlg::m_menu

The KryptosDlg menu

CEdit CKryptosDlg::m_ProgressBar2

A status bar that displays current activity

CFont CKryptosDlg::m_Font

The font

CAlgorithmSheet* CKryptosDlg::p_AlgorithmSheet

This points to the algorithm sheet, which indicates which algorithm the user wished to use.

CCryptoLink* CKryptosDlg::m_CryptoLink

This points to a subclass of CCryptoLink. Polymorphism will determine which actual function to call based on the what class this is pointing to

int CKryptosDlg::sheet_size

The size of this window

CBrush CKryptosDlg::m_BrushBlue

Brush information

COLORREF CKryptosDlg::m_Blue

Color information

CString CKryptosDlg::m_programTitle

Holds the title of this program

CString CKryptosDlg::m_CPU_time

Holds the CPU time

CString CKryptosDlg::m_CPU_cycles

Holds the CPU cycles

CString CKryptosDlg::m_CPU_cycles1

Holds the second set of CPU cycles

CString CKryptosDlg::m_CPU_time1

Holds the second set of CPU time

HICON CKryptosDlg::m_hIcon [protected]

The icon for this app

double CKryptosDlg::m_CPU_frequency [protected]

Holds the CPU frequency

double CKryptosDlg::m_CPU_avg_dev [protected]

Holds the CPU avg deviation


The documentation for this class was generated from the following files:
Generated on Sun Dec 17 14:54:16 2006 for Kryptos by  doxygen 1.5.1-p1