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 String Encryption

AES string encryption in VB.NET.

Download: Chilkat .NET Assemblies

Dim crypt As New Chilkat.Crypt2()

Dim success As Boolean
success = crypt.UnlockComponent("Anything for 30-day trial")
If (success <> true) Then
    MsgBox("Crypt component unlock failed")
    Exit Sub
End If


Dim password As String
password = "secretPassPhrase"

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

'  Generate a binary secret key from a password string
'  of any length.  For 128-bit encryption, GenEncodedSecretKey
'  generates the MD5 hash of the password and returns it
'  in the encoded form requested.  The 2nd param can be
'  "hex", "base64", "url", "quoted-printable", etc.
Dim hexKey As String
hexKey = crypt.GenEncodedSecretKey(password,"hex")
crypt.SetEncodedKey(hexKey,"hex")

crypt.EncodingMode = "base64"
Dim text As String
text = "The quick brown fox jumped over the lazy dog."

'  Encrypt a string and return the binary encrypted data
'  in a base-64 encoded string.
Dim encText As String
encText = crypt.EncryptStringENC(text)

TextBox1.Text = TextBox1.Text & encText & vbCrLf

'  Decrypt and show the original string:
Dim decryptedText As String
decryptedText = crypt.DecryptStringENC(encText)

TextBox1.Text = TextBox1.Text & decryptedText & vbCrLf
 

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

Mail Component · XML Parser