SymCipKeyGenerate.h

Go to the documentation of this file.
00001 /***********************************************************************
00002 *
00003 * KRYPTOS - Educational software for teaching cryptography
00004 * For more information, see http://www.kryptosproject.org/
00005 * Submissions may be sent to kryptos@gmu.edu (see web site for details)
00006 * 
00007 * 
00008 * Copyright (c) 2002-2004 George Mason University
00009 * 
00010 * Permission is hereby granted, free of charge, to any person obtaining
00011 * a copy of this software and associated documentation files (the
00012 * "Software"), to deal in the Software without restriction, including
00013 * without limitation the rights to use, copy, modify, merge, publish,
00014 * distribute, sublicense, and/or sell copies of the Software, and to
00015 * permit persons to whom the Software is furnished to do so, subject
00016 * to the following conditions:
00017 *
00018 * The above copyright notice and this permission notice shall be
00019 * included in all copies or substantial portions of the Software.
00020 *
00021 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00022 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00023 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00024 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00025 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00026 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00027 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00028 *
00029 ***********************************************************************/
00030 #if !defined(AFX_SYMCIPKEYGENERATE_H__11E6001B_8859_4149_8AAD_086F78804C83__INCLUDED_)
00031 #define AFX_SYMCIPKEYGENERATE_H__11E6001B_8859_4149_8AAD_086F78804C83__INCLUDED_
00032 
00033 #if _MSC_VER > 1000
00034 #pragma once
00035 #endif // _MSC_VER > 1000
00036 // SymCipKeyGenerate.h : header file
00037 //
00038 
00042 class CSymCipKeyGenerate : public CPropertyPage
00043 {
00044         DECLARE_DYNCREATE(CSymCipKeyGenerate)
00045 
00046 // Construction
00047 public:
00048         CSymCipKeyGenerate();
00049         ~CSymCipKeyGenerate();
00050 
00051         BOOL dirtyPage;
00052         
00054         int m_symCipKeyByteSize;
00055         char* m_symCipKeySizeCharArrayPtr;
00056 
00058         int m_symCipKeyStrength;
00059                 
00060         BYTE* m_kBuffer;
00061         
00063         int m_weakKeyIdx;
00065         int m_semiWeakKeyIdx;
00066 
00067         DWORD m_dwFileDialogFlags; 
00068         CString szFilter;
00069 
00070         void CorrectKeyParityBits (byte *key,int keyLength);
00071 
00072         void GenerateKey();
00073 
00074 // Dialog Data
00075         //{{AFX_DATA(CSymCipKeyGenerate)
00076         enum { IDD = IDD_PROPPAGE_SYM_CIP_KEY_GENERATE };
00077                 // NOTE - ClassWizard will add data members here.
00078                 //    DO NOT EDIT what you see in these blocks of generated code !
00079         //}}AFX_DATA
00080 
00081 
00082 // Overrides
00083         // ClassWizard generate virtual function overrides
00084         //{{AFX_VIRTUAL(CSymCipKeyGenerate)
00085         public:
00086         virtual BOOL OnSetActive();
00087         virtual void OnOK();
00088         virtual BOOL OnApply();
00089         virtual void OnCancel();
00090         protected:
00091         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00092         //}}AFX_VIRTUAL
00093 
00094 // Implementation
00095 protected:
00096         bool CheckParity(byte b);
00097         // Generated message map functions
00098         //{{AFX_MSG(CSymCipKeyGenerate)
00099         virtual BOOL OnInitDialog();
00100         afx_msg void OnProppageSymCipKeyGenerateRadioWeakKey();
00101         afx_msg void OnProppageSymCipKeyGenerateRadioSemiWeakKey();
00102         afx_msg void OnProppageSymCipKeyGenerateRadioRandomKey();
00103         afx_msg void OnProppageSymCipKeyGenerateGenerateKey();
00104         afx_msg void OnProppageSymCipKeyGenerateGeneratedSave();
00105         afx_msg void OnSelchangeProppageSymCipKeyGenerateWeakKeyCombo();
00106         afx_msg void OnSelchangeProppageSymCipKeyGenerateSemiWeakKeyCombo();
00107         afx_msg void OnProppageSymCipKeyGenerateGeneratedLoad();
00108         //}}AFX_MSG
00109         DECLARE_MESSAGE_MAP()
00110 
00111 public:
00112 //      afx_msg void OnClose();
00113 //      afx_msg void OnDestroy();
00114 };
00115 
00116 //{{AFX_INSERT_LOCATION}}
00117 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00118 
00119 #endif // !defined(AFX_SYMCIPKEYGENERATE_H__11E6001B_8859_4149_8AAD_086F78804C83__INCLUDED_)

Generated on Sun Dec 17 14:54:15 2006 for Kryptos by  doxygen 1.5.1-p1