/////////////////////////////////////////////////////////////////////////////
//  AESV3PluginMT   - AES V3 Plugin MT
//  ARC4V3PluginMT  - ARC4 V3 Plugin MT
//
//  Threadsafe 128-bit AES / ARC4 encryption UltraVNC DSM plugins
//  Adam D. Walling 2009
//
///////////////////////////////////////////////////////////////////////////////
//
// Please see the author's latest VNC DSM Plugin, SecureVNC, which provides
// simple, effective, secure VNC sessions, without requiring a pre-shared
// key or password! These plugins will no longer be further developed except 
// possibly for severe bugs, so give SecureVNC a shot!
//
////////////////////////////////////////////////////////////////////////////
//  Copyright (C) 2005 Ultr@Vnc.  All Rights Reserved.
//  Copyright (C) 1998-2002 The OpenSSL Project.  All rights reserved.
//  Copyright (C) 2005 Sean E. Covel.  All Rights Reserved.
//  Copyright (C) 2009 Adam D. Walling aka Adzm.  All Rights Reserved.
//
//  This product includes software developed by the OpenSSL Project for use 
//  in the OpenSSL Toolkit (http://openssl.org )
//
//  Initial AES plugin created by Sean E. Covel
//  based on UltraVNC's excellent TestPlugin project.
//
//  (2009)
//  Multithreaded DSM plugin framework created by Adam D. Walling
//  AES plugin migrated to new multithreaded framework by Adam D. Walling.
//  Backwards-compatible with existing DSM interface.
//
////////////////////////////////////////////////////////////////////////////
//
//  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.
//
// UltraVNC                 - http://ultravnc.sourceforge.net/
// OpenSSL                  - http://openssl.org 
// Sean E. Covel            - http://home.comcast.net/~msrc4plugin
//                          - mailto:msrc4plugin@comcast.net
// Adam D. Walling aka Adzm - http://adamwalling.com
//                          - mailto:adam.walling@gmail.com
//
////////////////////////////////////////////////////////////////////////////
//
// AES V3 Plugin 3.0.2.0
// ARC4 V3 Plugin 3.0.2.0
//
// CipherV3PluginMT 3.0.2.0 Source
//  - Built with Visual Studio 2008
//  - Statically-linked with OpenSSL 0.9.8k
//
////////////////////////////////////////////////////////////////////////////
//
// Please see the author's latest VNC DSM Plugin, SecureVNC, which provides
// simple, effective, secure VNC sessions, without requiring a pre-shared
// key or password! These plugins will no longer be further developed except 
// possibly for severe bugs, so give SecureVNC a shot!
//
////////////////////////////////////////////////////////////////////////////
//
// Behavior is the same as Sean E. Covel's original AES DSM plugin for 
// UltraVNC. Contains several bugfixes, and a new interface and architecture
// for threadsafe encryption and decryption. This allows multiple encrypted
// viewers in UltraVNC servers. Code changes were required in the server to
// support this new approach, which is not yet available in a public build.
// This plugin is backwards-compatible, however, and can be used with all
// existing builds of the UltraVNC viewer and server that support the 
// original DSM plugin standard.
//
// A 16-byte keyfile is searched for in the plugin directory, the parent
// process directory, the %PROGRAMFILES%\UltraVNC directory, the
// %PROGRAMFILES%\UltraVNC\Plugins directory, and finally the current
// directory. If not found, you should be prompted for a password. The
// password or keyfile is salted and hashed to create the initial key. Any
// file matching the pattern AES*.key or RC4*.key will be chosen. You may
// specify the environment variable AESV3PLUGINKEY or AESPLUGINKEY
// (or ARC4V3PLUGINKEY or ARC4PLUGINKEY if using the ARC4 version) to point
// directly to the keyfile; this will be checked before the paths above.
//
// Please contact me with any problems.
//
// Adam
//
////////////////////////////////////////////////////////////////////////////
//
// 3.0.2.0
//   - Properly supports Windows 2000 (Removed Interlocked SList functions)
//
// 3.0.1.8
//   - Added ARC4 build
//   - Several minor fixes for legacy support
//
// 3.0.1.7
//   - Initial release candidate
//
////////////////////////////////////////////////////////////////////////////