Easy Encryption

Applies To

OS:
VB:
NT, 9x, 2k, XP
5, 6

Download...(1 kb)

What is different about this encryption class?

That's it. Note that this class does not provide any industrial stregth encryption, but most of the time you don't need it. Don't confuse it with PGP, DES or anything else.

Here is a little piece of code showing how easy it is to encrypt/decrypt stuff.

Add the following code to class
Option Explicit

Private Sub Demo()
    Dim oEncryption As cEncrypt
    Dim sEncryptedText As String
    Dim sDecryptedText As String
    
    Const TEXT_TO_ENCRYPT As String = "Encrypt this"
        
    Set oEncryption = New cEncrypt
    With oEncryption
        'this step is optional
        'if PASSWORD property is not set,
        'the class will use the default password
        .PASSWORD = "1234567890"
        
        'all it takes to encrypt text
        sEncryptedText = oEncryption.Encrypt(TEXT_TO_ENCRYPT)
        
        'now let's decrypt it
        sDecryptedText = oEncryption.Decrypt(sEncryptedText)
    End With
    
    Set oEncryption = Nothing
    
End Sub