Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
DH Key Exchange
DKIM/DomainKeys
Digital Certificates
Digital Signatures
DSA
Email
Encryption
FTP
HTML-to-XML
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...
Email Object
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

 

 

Match MySQL AES_ENCRYPT Function

Demonstrates how to use the MySqlAesEncrypt and MySqlAesDecrypt methods to match MySQL's AES_ENCRYPT and AES_DECRYPT functions.

Here are MySQL AES_ENCRYPT test vectors:

HEX(AES_ENCRYPT('The quick brown fox jumps over the lazy dog','password'))
Output:
CC5FDDF621AE2F48241BB80EDF2422949526FBAAA74885ACB020A74CAAB98BCFA1DD12E5D4C7922A2F9205D367921D9B

HEX(AES_ENCRYPT('The quick brown fox jumps over the lazy dog','a'))
Output:
47A7E5FB591AD818BA3C9025D040514696BF50C2EFB0A453730E23E824F5F0357F3F673FCF0A7BD16465E82F937ED365

HEX(AES_ENCRYPT('The quick brown fox jumps over the lazy dog','1234567890123456'))
Output:
D70F1A158553B721C5DB9220A627E7B17BFF78FF7A72C4AB565AC903A94DF76DB75A30583D4ED01E265147D5A9B04EC3

HEX(AES_ENCRYPT('The quick brown fox jumps over the lazy dog','abcdefghijklmnopqrstuvwxyz'))
Output:
425F259AD4C3DD0B37831C8F24507D7E1F056437C0D50D3C18FB6F600FC941A8D871E7DD7BCBEE4CA4698F074C135275

Download Chilkat C/C++ Libraries for VC++ 10.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 10.0 / x64

Download Chilkat C/C++ Libraries for VC++ 9.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 9.0 / x64

Download Chilkat C/C++ Libraries for VC++ 8.0 / Win32

Download Chilkat C/C++ 64-bit Libraries for VC++ 8.0 / x64

Download Chilkat Visual Studio 2005 C/C++ Libs for Windows Mobile, Pocket PC, SmartPhone, WinCE

Download Chilkat C/C++ Libraries for VC++ 7.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0 / Win32

Download Chilkat C/C++ Libraries for VC++ 6.0, Win 95/98/NT4 Compatible

#include <CkCrypt2.h>

void ChilkatSample(void)
    {
    CkCrypt2 crypt;

    bool success;
    success = crypt.UnlockComponent("Anything for 30-day trial");
    if (success != true) {
        printf("%s\n",crypt.lastErrorText());
        return;
    }

    const char * clearText;
    clearText = "The quick brown fox jumps over the lazy dog";
    const char * password;
    const char * hexEncryptedStr;
    const char * decryptedStr;

    password = "password";
    hexEncryptedStr = crypt.mySqlAesEncrypt(clearText,password);
    printf("%s\n",hexEncryptedStr);
    decryptedStr = crypt.mySqlAesDecrypt(hexEncryptedStr,password);
    printf("%s\n",decryptedStr);

    password = "a";
    hexEncryptedStr = crypt.mySqlAesEncrypt(clearText,password);
    printf("%s\n",hexEncryptedStr);
    decryptedStr = crypt.mySqlAesDecrypt(hexEncryptedStr,password);
    printf("%s\n",decryptedStr);

    password = "1234567890123456";
    hexEncryptedStr = crypt.mySqlAesEncrypt(clearText,password);
    printf("%s\n",hexEncryptedStr);
    decryptedStr = crypt.mySqlAesDecrypt(hexEncryptedStr,password);
    printf("%s\n",decryptedStr);

    password = "abcdefghijklmnopqrstuvwxyz";
    hexEncryptedStr = crypt.mySqlAesEncrypt(clearText,password);
    printf("%s\n",hexEncryptedStr);
    decryptedStr = crypt.mySqlAesDecrypt(hexEncryptedStr,password);
    printf("%s\n",decryptedStr);

    }

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

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

Mail Component · .NET Mail Component · XML Parser