FoxPro Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Visual FoxPro Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
Email Object
FTP
HTML Conversion
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...
Amazon S3
DKIM / DomainKey
NTLM
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA
FileAccess
Bzip2
LZW

 

Non-Chilkat Links
Text and String Handling

ARC4 Encryption (ARCFOUR)

Download Chilkat Crypt ActiveX

Demonstrates simple ARC4 encryption to match some simple test vectors published by Wikipedia. ARC4 is a fast stream cipher supporting key lengths from 8 to 2048 bits (i.e. from 1 to 256 bytes). It is not a block cipher, so there is no padding, no modes, and no initialization vector.

LOCAL loCrypt
LOCAL lnSuccess
LOCAL lcCipherText
LOCAL lcPlainText

loCrypt = CreateObject('Chilkat.Crypt2')

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

*  Set the encryption algorithm to ARC4:
loCrypt.CryptAlgorithm = "arc4"

*  We want the encrypted output to be a hex-encoded string.
loCrypt.EncodingMode = "hex"

*  Encrypt some test vectors from Wikipedia:

*  The key length (in bits) is equal to the number of us-ascii
*  bytes in our key string * 8.

* ARC4( "Key", "Plaintext" ) == BBF316E8D940AF0AD3
loCrypt.KeyLength = 24
loCrypt.SetEncodedKey("Key","ascii")
lcCipherText = loCrypt.EncryptStringENC("Plaintext")
? lcCipherText
lcPlainText = loCrypt.DecryptStringENC(lcCipherText)
? lcPlainText

* ARC4( "Wiki", "pedia" ) == 1021BF0420
loCrypt.KeyLength = 32
loCrypt.SetEncodedKey("Wiki","ascii")
lcCipherText = loCrypt.EncryptStringENC("pedia")
? lcCipherText
lcPlainText = loCrypt.DecryptStringENC(lcCipherText)
? lcPlainText

* ARC4( "Secret", "Attack at dawn" ) == 45A01F645FC35B383552544B9BF5
loCrypt.KeyLength = 48
loCrypt.SetEncodedKey("Secret","ascii")
lcCipherText = loCrypt.EncryptStringENC("Attack at dawn")
? lcCipherText
lcPlainText = loCrypt.DecryptStringENC(lcCipherText)
? lcPlainText

*  Note: The call to SetEncodedKey serves to set the key
*  to the us-ascii bytes of the string.

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

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