Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
String
Tar
Unicode
Upload
XML
XMP
Zip Compression

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor


VB Strings
VB Byte Array

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

 

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

 

Need a specific example? Send a request to support@chilkatsoft.com

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