Skip to content

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

ModuleFilesDescription
AEScAes.cls, cAesCBC.clsAES CBC mode symmetric encryption
HashcCryptoHash.clsHash computation (MD5/SHA1/SHA256/SHA384/SHA512)
HMACcCryptoHMAC.clsHMAC message authentication codes (HMAC-SHA1/HMAC-SHA256)

✨ Key Features

FeatureDescription
AES EncryptionMSHTML-based AES-CBC encryption with string support
Multiple Hash AlgorithmsSupports MD5, SHA1, SHA256, SHA384, SHA512
HMAC SupportSupports HMAC-SHA1, HMAC-SHA256
Chainable APIHash and HMAC support fluent chainable API
Multiple Output FormatsSupports Hex, Base64, byte array output
File HashingSupports 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 files

Hash 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

DocumentDescription
aes/overview.mdAES encryption overview
aes/methods.mdAES methods reference
hash/overview.mdHash component overview
hash/methods.mdHash methods reference
hmac/overview.mdHMAC component overview
hmac/methods.mdHMAC methods reference

Last Updated: 2026-05-17

VB6 and LOGO copyright of Microsoft Corporation