C# Examples

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

C# Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
MIME
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

EncryptEncoded: Decode-->Encrypt Bytes-->Encode

In some programming languages, it is very difficult to work with binary data. To help avoid these problems, two new methods have been added to the Chilkat Crypt2 component: EncryptEncoded and DecryptEncoded.

EncryptEncoded takes binary data in the form of an encoded string (base64, hex, etc.), decodes it, encrypts, and then encodes the encrypted output and returns an encoded string (base64, hex, etc.).

DecryptEncoded does the opposite. It accepts encrypted data in the form of an encoded string, decodes, decrypts, and then returns the result as an encoded string.

The encoding is determined by the EncodingMode property. It may be "base64", "hex", "url", "quoted-printable", etc.

Note: The EncryptEncoded and DecryptEncoded methods are unreleased at the time of this writing (08-April-2008) The next major Chilkat Crypt2 release after this date will include these new methods.

Download Chilkat .NET for 4.0 Framework

Download Chilkat .NET for 64-bit 4.0 Framework (x64)

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 64-bit 2.0 / 3.5 Framework (x64)

Download Chilkat .NET for 1.0 / 1.1 Framework

Chilkat.Crypt2 crypt = new Chilkat.Crypt2();

bool success;
success = crypt.UnlockComponent("Anything for 30-day trial");
if (success != true) {
    //  Unlock failed.
    MessageBox.Show(crypt.LastErrorText);
    return;
}

crypt.CryptAlgorithm = "aes";
crypt.KeyLength = 128;

//  The encrypted output will be a hex-encoded string.
//  It is also possible to use "base64", "url" (for url-encoding), and other modes.
crypt.EncodingMode = "hex";

//  Both ECB and CBC modes are available.
//  Use "ecb" for Electronic Cookbook Mode.
//  "cbc" is for Cipher-Block-Chaining.
crypt.CipherMode = "ecb";

//  Key (128): E8E9EAEBEDEEEFF0F2F3F4F5F7F8F9FA
//  Plaintext: 014BAF2278A69D331D5180103643E99A
//  Ciphertext: 6743C3D1519AB4F2CD9A78AB09A511BD

crypt.SetEncodedKey("E8E9EAEBEDEEEFF0F2F3F4F5F7F8F9FA","hex");

crypt.PaddingScheme = 3;

string cipherHex;
string plainTextHex;

cipherHex = crypt.EncryptEncoded("014BAF2278A69D331D5180103643E99A");
textBox1.Text += cipherHex + "\r\n";

plainTextHex = crypt.DecryptEncoded(cipherHex);
textBox1.Text += plainTextHex + "\r\n";
 

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

Email Component · XML Parser