﻿WinKee - (c) 2009..2014 Theo Beisch (theo.beisch_at_gmx.de) 
Feel free to modify or distribute, just leave the credits

*********
Update 2014/12/06	Added plugin Revision number to show on windows form
Update 2014/11/08	WinKee autostart option
					WinKee will test if the database opens correctly and auto-unlock the database
Update 2018/06/09	Added 2.39.1 support (thanks to Dominik for providing the port) 
*********

WinKee helps to securely automate KeePass startup. WinKee separately encrypts, stores and 
retrieves KeePass database access credentials in the KeePass configuration (KeePass.config.xml) 
file. 

Password and keyfile path will be encrypted based on Windows account credentials - so anybody 
having access to the specific user account AND the WinKee database keyfile will be granted 
KeePass database access. KeePass and WinKee can be configured to automatically open a specified 
database via commandline argument options -keyfile: during a user's Windows session logon or at 
any time by e.g. using a batch file.

WinKee WinKeeDataBasePath.kdbx -keyfile:"WinKee - locally encrypted access" 

1. Installation: copy the WinKee.dll to the directory that contains KeePass.exe - KeePass will automatically recognize the plugin during start.

2. First use: 
- Start KeePass [select database]
- Do NOT enter database password in the main "Open Database" Dialog!
- Select "WinKee - locally encrypted access" from the keyfile dropdown 
- Press OK - now a similar looking form - the WinKee dialog - should open
- Enter the database password and the database keyfile
- Press ok - now your database should open (visibility depending on WinKee settings)
From now on KeePass (presently upon program exit) will store the encrypted credentials in the KeePass config file.

The credentials will be referenced with the PC's machine name, your domain name, your user name and the full database path. This supports WinKee use on different machines (e.g. from USB sticks) and/or with different databases.
 
3. Configure AutoStart:
If KeePass is configured to automatically start with a user session KeePass will create an autostart registry key named 'KeePass Password Safe' at 
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
If you modify the REG_SZ key (using regedit) to e.g. "[Drive]:[\Path]\KeePass.exe" "[Drive]:[\Path]\[DataBaseName].kdbx" -keyfile:"WinKee - locally encrypted access" KeePass will automatically activate WinKee, WinKee will load the encrypted credentials from the KeePass custom configuration and open the database.

Alternatively you could write a batch file in the AutoStart menu containing the same line to automatically launch KeePass and open the indicated database:
"[Drive]:[\Path]\KeePass.exe" "[Drive]:[\Path]\[DataBaseName].kdbx" -keyfile:"WinKee - locally encrypted access"

Enjoy!

tb