Implementing AES encryption with the MarshallSoft Advanced Encryption Standard Library (AES4VB) allows you to integrate strong 256-bit symmetric encryption directly into your Visual Basic applications. This approach bypasses the need for complex cryptographic coding by utilizing a pre-compiled Windows dynamic-link library (DLL).
The toolkit is cross-compatible, supporting legacy compilers like VB 4.0, 5.0, and 6.0 (.vbp projects) as well as modern VB.NET / Visual Studio environments (.vbproj projects). Key Technical Features
Cryptographic Core: Implements standard 256-bit AES (Rijndael) encryption with 14 rounds.
Operating Modes: Supports CBC (Cipher Block Chaining, which requires an Initialization Vector) and ECB (Electronic Codebook) modes.
Padding: Built-in support for PKCS7 padding to handle data blocks that do not naturally match the 16-byte boundary requirement.
Hashing & Key Exchange: Features integrated SHA-256 hashing functions and Diffie-Hellman key exchange logic.
Architecture Support: Ships with both 32-bit (aes32.dll) and 64-bit (aes64.dll) binaries. No registry entry (regsvr32) is required to deploy them. Step-by-Step Implementation Setup 1. Installation and Library Placement
Download the MarshallSoft AES4VB Toolkit evaluation or registered zip file.
Extract the archive and run SETUP.EXE to install the package.
Ensure aes32.dll (for 32-bit apps) or aes64.dll (for 64-bit apps) is either placed in your application directory or copied to the standard Windows system path (e.g., C:\Windows\System32). 2. Visual Studio Architecture Configuration (For VB.NET)
Because the library interacts with raw Win32/Win64 API calls, you must align your VB project platform with the DLL version you plan to load:
Open Configuration Manager in your Visual Studio project properties.
Change the Active Solution Platform from Any CPU to either x86 (to lock it to aes32.dll) or x64 (to lock it to aes64.dll). 3. API Declarations
Before invoking functions, declare them at the top of your VB module. For example, if you are targeting the 32-bit library (aes32.dll) in VB6 or VB.NET via P/Invoke:
’ Example for VB6 / VBA context Public Declare Function aesInit Lib “aes32.dll” (ByVal LicenseCode As Long) As Long Public Declare Function aesEncryptBuffer Lib “aes32.dll” (ByRef PlainText As Byte, ByRef CipherText As Byte, ByVal Length As Long, ByRef Key As Byte, ByRef IV As Byte, ByVal Mode As Long) As Long Public Declare Function aesDecryptBuffer Lib “aes32.dll” (ByRef CipherText As Byte, ByRef PlainText As Byte, ByVal Length As Long, ByRef Key As Byte, ByRef IV As Byte, ByVal Mode As Long) As Long Use code with caution. The Functional Core Workflow
When processing secure transactions inside your code, your program flow will follow these distinct phases:
[Initialize Library] ──> [Generate/Load 256-bit Key] ──> [Apply PKCS7 Padding] ──> [Encrypt/Decrypt] MarshallSoft Advanced Encryption Standard (AES) Library
Leave a Reply