C# Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CUnicode C++Unicode CMFCDelphi DLLDelphi ActiveXFoxProJavaPerlPHP 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

 

 

 

 

 

 

AES String Encryption

AES string encryption in C#.

Download: Chilkat .NET Assemblies

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

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

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

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

textBox1.Text += encText + "\r\n";

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

textBox1.Text += decryptedText + "\r\n";
 

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