Crypt Encryption Components Overview
📖 Introduction
The Crypt component provides a complete set of encryption and hashing functionality, including AES symmetric encryption, hash computation (MD5/SHA series), and HMAC message authentication codes.
📁 Module Structure
| Module | Files | Description |
|---|---|---|
| AES | cAes.cls, cAesCBC.cls | AES CBC mode symmetric encryption |
| Hash | cCryptoHash.cls | Hash computation (MD5/SHA1/SHA256/SHA384/SHA512) |
| HMAC | cCryptoHMAC.cls | HMAC message authentication codes (HMAC-SHA1/HMAC-SHA256) |
✨ Key Features
| Feature | Description |
|---|---|
| AES Encryption | MSHTML-based AES-CBC encryption with string support |
| Multiple Hash Algorithms | Supports MD5, SHA1, SHA256, SHA384, SHA512 |
| HMAC Support | Supports HMAC-SHA1, HMAC-SHA256 |
| Chainable API | Hash and HMAC support fluent chainable API |
| Multiple Output Formats | Supports Hex, Base64, byte array output |
| File Hashing | Supports direct file hash computation |
🚀 Quick Start
AES Encryption
vb
Dim Aes As New cAes
' Encrypt
cipherText = Aes.CBC.Encode("Hello World", "my-password-key-")
' Decrypt (Encode is bidirectional, requires JS decryptFn)
' Note: Current implementation depends on JS resource filesHash Computation
vb
Dim Hash As New cCryptoHash
' Simple way
hashValue = Hash.ComputeHash("Hello World")
' Chainable call
hashValue = Hash.Mode(HASH_ALG_SHA256) _
.DataString("Hello World") _
.ReturnHex()
' Compute file hash
fileHash = Hash.ComputeFileHash("C:\data.txt")HMAC Computation
vb
Dim Hmac As New cCryptoHMAC
' Simple way
result = Hmac.Compute("data", "secret-key")
' Chainable call
result = Hmac.Mode(HMAC_ALG_SHA256) _
.Secret("secret-key") _
.DataString("data") _
.ReturnHex()📁 Documentation Navigation
| Document | Description |
|---|---|
| aes/overview.md | AES encryption overview |
| aes/methods.md | AES methods reference |
| hash/overview.md | Hash component overview |
| hash/methods.md | Hash methods reference |
| hmac/overview.md | HMAC component overview |
| hmac/methods.md | HMAC methods reference |
Last Updated: 2026-05-17