Click here to Skip to main content
12,398,225 members (61,807 online)
Click here to Skip to main content

Stats

701.8K views
23.9K downloads
737 bookmarked
Posted

KeePass Password Safe

, 2 Mar 2016 GPL3
KeePass is a free, open-source, light-weight and easy-to-use password safe.
KeePass.chm
KeePass.exe
Build
Docs
Ext
Icons_04_CB
Finals
Finals2
plock-blu.ico
plock-dis.ico
plock.ico
plockb.ico
key-blu.png
key-bw.png
key-grn.ico
key-grn.png
plock-blu.ico
plock-blu.png
plock-bw.png
plock-dis.ico
plock-grn.ico
plock-grn.png
plock.ico
plock.png
plockb.png
plockbw-r.png
plockbw.png
Untitled.ico
key-org.ico
keyhole-grn.ico
lockblue.ico
lockgreen.ico
lockred.ico
lockyellow.ico
plockb.ico
plockb2.ico
plockbw.ico
plockg.ico
plocko.ico
plockr.ico
plocky.ico
Icons_15_VA
KeePass_Round
KeePass_Round_1024.png
KeePass_Round_128.png
KeePass_Round_16.png
KeePass_Round_256.png
KeePass_Round_32.png
KeePass_Round_48.png
KeePass_Round_512.png
KeePass_Round_64.png
KeePass_Round_Keyhole
KeePass_Round_Keyhole_128.png
KeePass_Round_Keyhole_16.png
KeePass_Round_Keyhole_256.png
KeePass_Round_Keyhole_32.png
KeePass_Round_Keyhole_48.png
KeePass_Round_Keyhole_64.png
KeePass_Round_Locked
KeePass_Round_Locked_128.png
KeePass_Round_Locked_16.png
KeePass_Round_Locked_256.png
KeePass_Round_Locked_32.png
KeePass_Round_Locked_48.png
KeePass_Round_Locked_64.png
KeePass_Square_Blue
KeePass_Square_Blue_128.png
KeePass_Square_Blue_16.png
KeePass_Square_Blue_256.png
KeePass_Square_Blue_32.png
KeePass_Square_Blue_48.png
KeePass_Square_Blue_64.png
KeePass_Square_Blue_Locked
KeePass_Square_Blue_Locked_128.png
KeePass_Square_Blue_Locked_16.png
KeePass_Square_Blue_Locked_256.png
KeePass_Square_Blue_Locked_32.png
KeePass_Square_Blue_Locked_48.png
KeePass_Square_Blue_Locked_64.png
KeePass_Square_Yellow
KeePass_Square_Yellow_128.png
KeePass_Square_Yellow_16.png
KeePass_Square_Yellow_256.png
KeePass_Square_Yellow_32.png
KeePass_Square_Yellow_48.png
KeePass_Square_Yellow_64.png
Icons_Nuvola
KeePass.ini
KeePass.iss
KeePassMsi
KeePassMsi.vdproj
KeePassLibC
KeePassLibCpp
Crypto
SHA2
DataExchange
Details
IO
PasswordGenerator
SDK
Details
SysSpec_Windows
Util
KeePassAPI
KeePassLib.def
res
WinGUI
NewGUI
TaskbarListEx
TaskDialog
VistaMenu
Plugins
res
autotype.bmp
cancel.bmp
clienticex.bmp
clock.bmp
disk.bmp
document.bmp
entry_ed.ico
file.bmp
help_sma.bmp
help_smp.bmp
iconpic.ico
infoicon.bmp
infoiconex.bmp
KeePass.png
key.ico
keyhole.ico
key_smal.bmp
language.bmp
locked.ico
lock_ovr.ico
MostPopularPasswords.bin
mouse_sm.bmp
ok.bmp
optionicex.bmp
options.ico
plugins.ico
PwSafe.ico
randomke.bmp
random_b.bmp
search.ico
tb_about.bmp
tb_adden.bmp
tb_copyp.bmp
tb_copyu.bmp
tb_defau.bmp
tb_delet.bmp
tb_edite.bmp
tb_find.bmp
tb_lock.bmp
tb_new.bmp
tb_open.bmp
tb_save.bmp
tb_save1.bmp
tb_saved.bmp
toolssma.bmp
unlocked.ico
winprops.bmp
world.ico
Util
CmdLine
SprEngine
/*
  KeePass Password Safe - The Open-Source Password Manager
  Copyright (C) 2003-2016 Dominik Reichl <dominik.reichl@t-online.de>

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef ___MEM_PROTECTION_UTIL_H___
#define ___MEM_PROTECTION_UTIL_H___

#pragma once

#include <wincrypt.h>
#include <boost/utility.hpp>

#define MPU_CRYPTLIB_NAME    _T("Crypt32.dll")

#ifndef _WIN32_WCE
#define MPU_CRYPTPROT_NAME   "CryptProtectMemory"
#define MPU_CRYPTUNPROT_NAME "CryptUnprotectMemory"
#else
#define MPU_CRYPTPROT_NAME   _T("CryptProtectMemory")
#define MPU_CRYPTUNPROT_NAME _T("CryptUnprotectMemory")
#endif

typedef BOOL(WINAPI *LPFNCRYPTPROTECTMEMORY)(LPVOID pData, DWORD cbData, DWORD dwFlags);
typedef BOOL(WINAPI *LPFNCRYPTUNPROTECTMEMORY)(LPVOID pData, DWORD cbData, DWORD dwFlags);

class CMemoryProtectionEx : boost::noncopyable
{
public:
	static void SetEnabled(BOOL bEnabled);
	static void SetEnabledAtStart(BOOL bEnabled);
	static BOOL* GetEnabledPtr();

	static void Release(); // Call at application shutdown

	static DWORD ToBlockSize(DWORD dwByteCount);

	static HRESULT EncryptMemory(LPVOID lpBuffer, DWORD cbSize);
	static HRESULT DecryptMemory(LPVOID lpBuffer, DWORD cbSize);

	static HRESULT EncryptText(LPTSTR lpText, DWORD dwCharacters);
	static HRESULT DecryptText(LPTSTR lpText, DWORD dwCharacters);

	// static void Benchmark();

private:
	CMemoryProtectionEx();
	~CMemoryProtectionEx();

	static void LoadCryptLib();
	static void FreeCryptLib();

	static BOOL m_bEnabled;
	static BOOL m_bEnabledAtStart;

	static bool m_bSupportTested;
	static HMODULE m_hCryptLib;
	static LPFNCRYPTPROTECTMEMORY m_lpCryptProtectMemory;
	static LPFNCRYPTUNPROTECTMEMORY m_lpCryptUnprotectMemory;
};

#endif // ___MEM_PROTECTION_UTIL_H___

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 GNU General Public License (GPLv3)

Share

About the Author

Dominik Reichl
Software Developer
Germany Germany
Dominik started programming in Omikron Basic, a programming language for the good old Atari ST. After this, there was some short period of QBasic programming on the PC, but soon he began learning C++, which is his favorite language up to now.

Today, his programming experience includes C / C++ / [Visual] C++ [MFC], C#/.NET, Java, JavaScript, PHP and HTML and the basics of pure assembler.

He is interested in almost everything that has to do with computing, his special interests are security and data compression.

You can find his latest freeware, open-source projects and all articles on his homepage: http://www.dominik-reichl.de/

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160721.1 | Last Updated 2 Mar 2016
Article Copyright 2003 by Dominik Reichl
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid