VB.NET Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

VB.NET Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
PFX
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression
Misc

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

Byte Array
VB.NET FTPS
System.IO

 

 

 

 

 

 

AES symmetric encryption as defined by NIST

Download: Chilkat .NET Assemblies

Example program to encrypt byte data using 128-bit AES CBC encryption.

' Create an instance of the Chilkat encryption class.
        Dim crypt As New Chilkat.Crypt2()

        ' Any code begins the 30-day trial.
        crypt.UnlockComponent("30-day-trial")

        ' Encrypt with...
        ' AES symmetric encryption as defined by NIST. 
        ' 128 bit keys. 
        ' Cipher block chaining mode (CBC). 
        ' 128 bit initialization vector prefixing the ciphertext. 
        ' Padding according to RFC 2630

        crypt.CryptAlgorithm = "aes"
        crypt.CipherMode = "cbc"

        ' Set the password.
        crypt.SecretKey = crypt.GenerateSecretKey("myPassword")

        Dim iv(16) As Byte
        ' Set the IV to any value desired...
        crypt.IV = iv

        ' RFC 2630 uses this padding scheme, which is identical to RFC 1423
        ' (for AES, k = 16)
        '        Some content-encryption algorithms assume the input length is a
        '        multiple of k octets, where k is greater than one.  For such
        '        algorithms, the input shall be padded at the trailing end with
        '        k-(lth mod k) octets all having value k-(lth mod k), where lth is
        '        the length of the input.  In other words, the input is padded at
        '        the trailing end with one of the following strings:
        '
        '                            01 -- if lth mod k = k-1
        '                        02 02 -- if lth mod k = k-2
        '                            .
        '                            .
        '                            .
        '                    k k ... k k -- if lth mod k = 0
        '
        '        The padding can be removed unambiguously since all input is padded,
        '        including input values that are already a multiple of the block size,
        '        and no padding string is a suffix of another.  This padding method is
        '        well defined if and only if k is less than 256.
        crypt.PaddingScheme = 0

        ' Encrypt some data...
        Dim inputByteData(1000) As Byte
        ' ....
        Dim encryptedBytes() As Byte
        encryptedBytes = crypt.EncryptBytes(inputByteData)


Important: The download for this example does not contain the ChilkatDotNet.dll which
must be downloaded and installed separately at http://www.chilkatsoft.com/downloads.asp.
Once installed, add a reference to the DLL in the project by following the instructions at
http://www.example-code.com/vbdotnet/step2.asp

 

© 2000-2012 Chilkat Software, Inc. All Rights Reserved.

Mail Component · XML Parser