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
| Feature | Description |
|---|---|
| CBC Mode | Uses CBC mode for encryption |
| Key Derivation | Derives encryption key from password string |
| String Encryption | Directly 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
- Resource Dependency: Component depends on
AES.CBCJavaScript resource, resource files must be properly configured - Password Length: 16-byte password is recommended
- Decryption: Current component only provides encryption; decryption needs to be implemented on the JavaScript side
🔗 Related Documentation
- methods.md - Methods detailed reference
Last Updated: 2026-05-17