VBScript Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VBScript Examples

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

More Examples...
Email Object
POP3
SMTP
Byte Array
RSS
Atom

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

 

 

 

 

 

 

 

AES String Encryption

AES string encryption in VBScript.

Download Chilkat Crypt ActiveX

Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

set crypt = CreateObject("Chilkat.Crypt2")

success = crypt.UnlockComponent("Anything for 30-day trial")
If (success <> 1) Then
    MsgBox "Crypt component unlock failed"
    WScript.Quit
End If

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.
hexKey = crypt.GenEncodedSecretKey(password,"hex")
crypt.SetEncodedKey hexKey,"hex"

crypt.EncodingMode = "base64"
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.
encText = crypt.EncryptStringENC(text)

outFile.WriteLine(encText)

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

outFile.WriteLine(decryptedText)
outFile.Close

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

© 2003-2007 Chilkat Software, Inc. All Rights Reserved.

Mail Component · XML Parser