Our Products
Classes
BMP
Crypto
CSVStrings
DataLogger
Dates
DebugRecorder
FileNameSet
FileSender
RDOConnectMaster
ReportAids
Sheller
StringSet
WEBUtilities
Modules
DAOLib
Globals
Registry
Programs
Batcher
HTMLGen
KillTime
TimedMessage
|
Crypto: This class provides a thin wrapper around the Crypto functions that are provided with
Internet Explorer, making it easy (in just 6 lines) to utilize first
class encryption in your applications.
InBuffer, OutBuffer, and Password are properties for setting and retrieving the string to be encoded/decoded along
with the password that acts as the key for the Crypto algorithms.
Methods Encrypt and Decrypt do the actual dirty work.
With just two actions, it's almost a trivial class. But it provides for encryption that is
far superior to simple character substitution methods. To see a sample use of Crypto and its full
interface definition, scroll down. |
 |
| Here are two examples of how you might use Crypto
in one of your programs. We use Crypto to protect sensitive database fields, like signature images, from prying eyes. |
| This subroutine uses Crypto to decode a printer string that will cause an HP printer to print a signature. The encryption key is just the employee Id contatenated with a reversed version of the employee Id. After setting the key all that's left to do is provide the coded string, command the decryption, and retrieve the unencoded string. |
Sub Load(UID, PtrString) As Boolean 'Loads Signature identified by UID.
Dim co As Crypto 'declare object
Set co = New Crypto 'initialize it
co.Password = UID + ReverseString(UID) 'set encoding key
co.InBuffer = GetSignature(UID) 'pass in string to decode
co.Decrypt 'decode printer string
PtrString = co.OutBuffer 'retrieve decoded string
Set co = Nothing 'clean up memory
End Sub
|
| This subroutine uses Crypto to encode a printer string that causes an HP printer to print a signature. The encryption key is just the employee Id contatenated with a reversed version of the employee Id. After setting the key all that's left to do is provide the string to be encoded, command the encryption, and retrieve the coded string. |
Sub Store(UID, PtrStr) As Boolean 'Encode & Store PtrStr identified by UID.
Dim co As Crypto 'declare object
Set co = New Crypto 'initialize it
co.Password = UID + ReverseString(UID) 'set encoding key
co.InBuffer = PtrStr 'pass in string to encode
co.Encrypt 'code printer string
Call StoreSig(UID, co.OutBuffer) 'retrieve coded string and store
Set co = Nothing 'clean up memory
End Sub
|
| The following is the full interface definition for the Crypto Class. |
Public Property Get Password() As String 'Return current password
Public Property Let Password(ByVal vNewValue As String) 'Set password
Public Property Get InBuffer() As String 'Return input buffer
Public Property Let InBuffer(ByVal vNewValue As String) 'Set input buffer
Public Property Get OutBuffer() As String 'Return output buffer
Public Property Let OutBuffer(ByVal vNewValue As String) 'Set output buffer
Public Sub Encrypt() 'Encodes inbuffer; results in outbuffer
Public Sub Decrypt() 'Decodes inbuffer; results in outbuffer
|
|