Visual Basic Examples

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

VB Examples

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

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


VB Strings
VB Byte Array

 

 

 

 

 

 

 

VB source to AES Encrypt String - ANSI String vs. Unicode String

Download Chilkat Crypt ActiveX

This example demonstrates two ways to encrypt strings. The first encrypts an ANSI string (1 byte per character) while the second encrypts a Unicode string (2 bytes per character).

Private Sub Form_Load()

   Dim aes As ChilkatCrypt2
   Set aes = New ChilkatCrypt2
   
   ' Setup the encryption object for 128-bit AES (Rijndael) encryption
   aes.UnlockComponent "UnlockCode"
   aes.CryptAlgorithm = "rijndael"
   aes.KeyLength = 128
   aes.SecretKey = aes.GenerateSecretKey("MyPassword")
   
   ' Use base64 encoding for output strings.
   aes.EncodingMode = "Base64"
   
   ' Encrypt an ANSI string (1-byte per character)
   aes.Charset = "ANSI"
   Text1.Text = aes.EncryptStringENC(InText)
  
   ' Encrypt a Unicode string (2-bytes per character)
   aes.Charset = "Unicode"
   Text2.Text = aes.EncryptStringENC(InText)
   
   Set aes = Nothing

End Sub

 

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