Skip to content

AES Encryption Component Overview

📖 Introduction

The AES encryption component provides symmetric encryption functionality based on JavaScript AES-CBC implementation. Encryption is performed via MSHTML control calling JavaScript encryption functions.

🏗️ Architecture

cAes (main entry)
  └── cAesCBC (CBC mode implementation)
        └── MSHTML.HTMLDocument
              └── JavaScript AES encryption functions

⚙️ How It Works

The component loads JavaScript code from resource files (AES.CBC resource) and executes encryption operations in the MSHTML environment.

Dependencies:

  • Requires AES JavaScript code resource file
  • Depends on MSHTML control

✨ Features

FeatureDescription
CBC ModeUses CBC mode for encryption
Key DerivationDerives encryption key from password string
String EncryptionDirectly encrypts strings

🚀 Quick Start

Basic Usage

vb
Dim Aes As New cAes

' Encrypt text (using default password)
Dim encrypted As String
encrypted = Aes.CBC.Encode("Hello World")

' Encrypt with custom password
encrypted = Aes.CBC.Encode("Hello World", "my-secret-password")

Complete Example

vb
Private Sub TestAes()
    Dim Aes As New cAes
    Dim plainText As String
    Dim cipherText As String
    
    plainText = "Sensitive data to encrypt"
    
    ' Encrypt
    cipherText = Aes.CBC.Encode(plainText, "my-password-1234")
    Debug.Print "Encrypted: " & cipherText
    
    ' Note: Decryption needs to be implemented via JavaScript decryptFn function
End Sub

⚠️ Notes

  1. Resource Dependency: Component depends on AES.CBC JavaScript resource, resource files must be properly configured
  2. Password Length: 16-byte password is recommended
  3. Decryption: Current component only provides encryption; decryption needs to be implemented on the JavaScript side

Last Updated: 2026-05-17

VB6 and LOGO copyright of Microsoft Corporation