FoxPro Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual FoxPro Examples

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

More Examples...
Email Object
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
FileAccess
Bzip2
LZW
Icon

 

Non-Chilkat Links
Text and String Handling

2-Key Triple DES

Demonstrates 2-Key Triple DES encryption (112-bit 3DES encryption).

Download Chilkat Crypt ActiveX

LOCAL loCrypt
LOCAL lnSuccess
LOCAL lcKeyHex
LOCAL lcEncStr
LOCAL lcDecStr

loCrypt = CreateObject('Chilkat.Crypt2')

lnSuccess = loCrypt.UnlockComponent("Anything for 30-day trial.")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX("Crypt component unlock failed")
    QUIT
ENDIF

*  Specify 3DES for the encryption algorithm:
loCrypt.CryptAlgorithm = "3des"

loCrypt.CipherMode = "ecb"

*  For 2-Key Triple-DES, use a key length of 128
*  (Given that each byte's msb is a parity bit, the strength is really 112 bits).
loCrypt.KeyLength = 128

*  Pad with zeros
loCrypt.PaddingScheme = 3

*  EncodingMode specifies the encoding of the output for
*  encryption, and the input for decryption.
*  It may be "hex", "url", "base64", or "quoted-printable".
loCrypt.EncodingMode = "hex"

*  Let's create a secret key by using the MD5 hash of a password.
*  The Digest-MD5 algorithm produces a 16-byte hash (i.e. 128 bits)
loCrypt.HashAlgorithm = "md5"

lcKeyHex = loCrypt.HashStringENC("secretPassword")

*  Set the encryption key:
loCrypt.SetEncodedKey(lcKeyHex,"hex")

*  Encrypt

lcEncStr = loCrypt.EncryptStringENC("The quick brown fox jumped over the lazy dog")
=MESSAGEBOX(lcEncStr)

*  Now decrypt:

lcDecStr = loCrypt.DecryptStringENC(lcEncStr)
=MESSAGEBOX(lcDecStr)

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

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

Mail Component · .NET Email Component · ASP Mail Component · XML Parser