Jump: Search:

Total Visual SourceBook

Total Visual SourceBook CD and Printed Manual

Microsoft Access 2007/2010 Version
is Shipping!

New features in Total Visual SourceBook for Access, Office 2007 and VB6

Supports Access/Office 2010 (32 bit), 2007, 2003, 2002, 2000, and
Visual Basic 6.0!

Also available for:
Access 97/95


View all FMS products for Microsoft AccessAll Our Microsoft Access Products

SourceBook Info:

Why SourceBook?

 

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP

 

 

 

 

 
Royalty free source code library modules for Microsoft Access, VB6, VBA, OfficeRoyalty free source code library modules for Microsoft Access, VB6, VBA, OfficeVBA and VB6 Source Code Library Download the free trial version of Total Visual SourceBook for Microsoft Access, Office, VB6 and VBA
Category: General VBA/VB6 : Encryption and Compression
Description: Encryption and compression operations

Class: CEncryption

Class that encrypts and decrypts a file or string.

This class is Unicode enabled. There are methods included for encrypting both files and strings. This class uses XOR password encryption. The password is also encrypted as the string or file is processed, providing an additional level of security.

Procedure Name

Type

Description

(Declarations) Declarations Declarations and private variables for the CEncryption class
InputFileName Property Gets the name of the input file
OutputFileName Property Gets the name of the output file
Password Property Gets the password
Class_Initialize Initialize Set initial values to defaults which may be overridden with property settings
EncryptByte Private Encrypts one byte, and modifies the password. Modifying the password as we encrypt makes the encyption slightly harder to break.
EncryptFile Method Encrypts the file specified in m_strInputFileName to the file specified in m_strOutPutFileName. This procedure uses buffered file reads and writes for better performance. The encrypted file produced by the method is reversible. This means that if you encrypt a file, reverse the InputFileName and OutputFileName properties, and call this method again, the original file is restored. Please note that the same password must be supplied to successfully decrypt the file. This method also raises an event called file progress. This event can be used to track the progress of the file being processed. Please see the example tab for an example of how to use this event. This method also uses a file buffer. Using a file buffer significantly speeds up the performance of this method.
EncryptString Method Encrypts/Decrypts the passed string with XOR encryption. The encrypted string produced by the method is reversible. This means that if you encrypt a string, then encrypt the results of that operation, the original string is restored. Please note that the same password must be supplied to successfully decrypt the string. Please see the example tab for a demonstration of this. If you need and ASCII version of this function, please see the EncryptStringANSI method.
EncryptStringAscii Method Encrypts/Decrypts the passed string with XOR encryption, returning the result in ASCII format. The encrypted string produced by the method is reversible. This means that if you encrypt a string, then encrypt the results of that operation, the original string is restored. Please note that the same password must be supplied to successfully decrypt the string. Please see the example tab for a demonstration of this. The EncryptStringAscii method returns the result in ASCII format. If you need to pass the results of the EncryptString function on the command line, or use it external to your program, it is recommended that you use the ASCII version of this function.
ReadFile Private Reads the specified number of bytes from the file. Using this function significantly increases the speed of processing files. The alternative to using a file buffer is reading a byte at a time from the file.

Overview of Total Visual SourceBook

The source code in Total Visual SourceBook includes modules and classes for Microsoft Access, Visual Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily add this professionally written, tested, and documented royalty-free code into your applications to simplify your application development efforts.

Additional Resources

Feedback

Contact Us  l   Web questions: Webmaster   l   Copyright © FMS, Inc., Vienna, Virginia
Celebrating our 26th Year of Software Excellence