Use:

-Instantiate the object
-use the SessionStart method
-use EncryptFile or EncryptString or DecryptFile or DecryptString
-if you have many things to encrypt or decrypt do them all at once
-use the SessionEnd method when finished
-set the object = nothing

**********************************************************************

This project encrypts/decrypts a string or file (using the CryptAPI included with Windows) using a single user-entered key.  This is not another "you can't break my new encryption" snippet written by a 12-year-old (I guarantee the NSA can break every one on this site with only a calculator, in 5 minutes).  The CryptAPI uses business/government grade encryption methods designed for use in business applications.  If you want encryption ignore everything but the CryptAPI.  Period.

This code was adapted from code originally posted by Fredrik Qvarfort (he demonstrated 7 REAL encryption algorithms in VB plus the CryptAPI).  I wanted to focus on the API so I improved on that one object.  My major addition is the ability to generate a random SALT and set the SALT.  If you don't know what a SALT is you must read all of Microsoft's site on using the CryptAPI:
http://msdn.microsoft.com/library/psdk/crypto/portalapi_3351.htm?RLD=290
They explain how everything works.  It is beyond code notation or this README file to explain it.  Complicated at first, but by following this code you see what they mean.

I also reduced the number of subroutines used and added two new methods to open and close the crypt context handle.  This is for performance reasons.  If you need to encrypt multiple items it is much faster to get a handle, do all the encryption, and then close the handle when finished.  The old code opened and closed a handle each time.

I plan to update this in the future to include RSA Public/Private key concryption using the CryptAPI.  Then this will be a complete example of the use of the Cryptography API.