Encryption Toolkit

NCryptoWrapper Add On

This add-on to the Nickellie Encryption Toolkit was developed to make it even easier to use the Encryption Toolkit to create applications requiring encryption and decryption from Visual Basic and ASP. It provides a simple wrapper class for use in Visual Basic and ASP. This class provides direct support for additional data types and support for "database-safe" encrypted strings. The class is written in Visual Basic for ease of understanding and to simplify the example.

Examples

For detailed examples on using the NCryptoWrapper Class from VB and ASP, read the article "Wrapping the Toolkit to Simplify Development".

License and Source Code

This add-on utility is provided free for use with the Nickellie Encryption Toolkit. The terms of the End User License Agreement that accompany the toolkit apply, except that this utility and its source code may be freely used, modified, and distributed.

The download includes complete source for the NCryptoWrapper class and the VB and ASP examples discussed in the article "Wrapping the Toolkit to Simplify Development".

Public Methods

EncryptFile(filename As Variant, password As Variant) As String This method provides a wrapper to the NCrypto.EncryptFile method. The method adds support for passing the filename and password as variants, and includes some additional error handling.

DecryptFile(filename As Variant, password As Variant) As String This method provides a wrapper to the NCrypto.DecryptFile method. The method adds support for passing the filename and password as variants, and includes some additional error handling.

EncryptDataSafe(ByRef inData As Variant, ByRef password As Variant) As Variant This method provides a wrapper to the NCrypto.EncryptData method. This method accepts the data to encrypt as a string, byte array, variant strings, variant byte array, or variant array of variant bytes. The encrypted data is encrypted and then converted to a "safe" byte array, that is, a byte array consisting only of alphanumeric characters that be used as a string or inserted into a character type database field.

DecryptDataSafe(ByRef inData As Variant, ByRef password As Variant) As Variant This method provides a wrapper to the NCrypto.DecryptData method. This method accepts the "safe" encrypted data to decrypt as a string, byte array, variant strings, variant byte array, or variant array of variant bytes. The "safe" encrypted data is converted and then decrypted and and returned as an array of bytes.

EncryptStringSafe(ByRef inData As Variant, ByRef password As Variant) As Variant This method provides a wrapper to the EncryptDataSafe method that makes encrypting strings very simple. The function accepts the data to encrypt as a string and returns the encrypted data as a "safe" encrypted string, that is, a string consisting only of alphanumeric characters that be used as a string or inserted into a character type database field.

DecryptStringSafe(ByRef inData As Variant, ByRef password As Variant) As Variant This method provides a wrapper to the DecryptDataSafe method that makes decrypting strings very simple. The function accepts an encrypted "safe" string and returns the original data as a string.