Visual C++ Examples

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

C++ Examples

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


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

 

 

AES String Encryption

AES string encryption in C++.

Downloads:

MS Windows Visual C/C++ Libraries
Linux/CentOS C/C++ Libraries
MAC OS X C/C++ Libraries
Solaris C/C++ Libraries
C++ Builder Libraries
FreeBSD C++ Libraries
HP-UX C++ Libraries
BlackBerry QNX C++ Libraries
#include <CkCrypt2.h>

void ChilkatSample(void)
    {
    CkCrypt2 crypt;

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

    const char * password;
    password = "secretPassPhrase";

    crypt.put_CryptAlgorithm("aes");
    crypt.put_CipherMode("cbc");
    crypt.put_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.
    const char * hexKey;
    hexKey = crypt.genEncodedSecretKey(password,"hex");
    crypt.SetEncodedKey(hexKey,"hex");

    crypt.put_EncodingMode("base64");
    const char * 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.
    const char * encText;
    encText = crypt.encryptStringENC(text);

    printf("%s\n",encText);

    //  Decrypt and show the original string:
    const char * decryptedText;
    decryptedText = crypt.decryptStringENC(encText);

    printf("%s\n",decryptedText);
    }

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

Mail Component · .NET Mail Component · XML Parser