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

 

 

 

 

 

 

Blowfish Encrypt + BZIP2 Compression to URL-Encoded Strings

Download: Chilkat .NET Assemblies

This example code shows how to do BZIP2 compress and Blowfish encrypt a string, returning a URL-encoded compressed string.

        ' This example uses the Chilkat .NET encryption library, which can be downloaded
        ' at http://www.chilkatsoft.com/downloads.asp

        ' 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")

        ' Select 128-bit AES encryption and set the password.
        crypt.CryptAlgorithm = "AES"
        crypt.KeyLength = 128
        crypt.SecretKey = crypt.GenerateSecretKey("myPassword")

        ' Select the BZIP2 compression algorithm
        crypt.CompressionAlgorithm = "bzip2"

        ' We want the result to be url-encoded.
        crypt.EncodingMode = "url"

        ' Generate some data to BZIP2 compress and Blowfish encrypt.
        Dim str As String
        Dim i As Integer
        For i = 1 To 10
            str = str + "This is VB.NET Blowfish BZIP2 example " & i & vbCrLf
        Next

        Dim compressedBytes() As Byte
        compressedBytes = crypt.CompressString(str)

        ' Blowfish encrypt the string, 
        ' returning a url-encoded compressed string.
        Dim outStr As String
        outStr = crypt.EncryptBytesENC(compressedBytes)

        ' Now decrypt and unzip the string.
        Dim compressedBytes2() As Byte
        compressedBytes2 = crypt.DecryptBytesENC(outStr)

        Dim original As String
        original = crypt.InflateString(compressedBytes2)


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