Click here to Skip to main content
15,894,410 members
Articles / Desktop Programming / MFC

A Simple, Portable, Rinjdael (AES) Based Stream Cipher Class

Rate me:
Please Sign up or sign in to vote.
4.45/5 (18 votes)
5 Jul 2005CDDL6 min read 136.1K   3.4K   52  
A file encryption/decryption class with built in MD5 string and file hashing.
// MyDlgBar.cpp : implementation file
//

#include "stdafx.h"
#include "Crypto.h"
#include "MyDlgBar.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMyDlgBar dialog


CMyDlgBar::CMyDlgBar()
{
	//{{AFX_DATA_INIT(CMyDlgBar)
	m_szPassword = _T("");
	//}}AFX_DATA_INIT
}


void CMyDlgBar::DoDataExchange(CDataExchange* pDX)
{
	CDialogBar::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMyDlgBar)
	DDX_Control(pDX, IDC_PASSWORD_EDIT, m_password);
	DDX_Text(pDX, IDC_PASSWORD_EDIT, m_szPassword);
	DDV_MaxChars(pDX, m_szPassword, 255);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMyDlgBar, CDialogBar)
	//{{AFX_MSG_MAP(CMyDlgBar)
	//}}AFX_MSG_MAP
	ON_MESSAGE(WM_INITDIALOG, OnInitDialog )
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyDlgBar message handlers

LONG CMyDlgBar::OnInitDialog ( UINT wParam, LONG lParam)
{

            BOOL bRet = HandleInitDialog(wParam, lParam);

            if (!UpdateData(FALSE))
            {
               TRACE0("Warning: UpdateData failed during dialog init.\n");
            }

            return bRet;

}


BOOL CMyDlgBar::Create(CWnd* pParent, UINT nIDTemplate, UINT nStyle, UINT nID) 
{
		
	BOOL bReturn = CDialogBar::Create(pParent, nIDTemplate, nStyle, nID);

	//add your control initialization code here AFTER calling base class

	return bReturn;
}


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)


Written By
United States United States
I have no biography, but then, I don't have an obituary yet either -- Thank God!!

Comments and Discussions