Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

CkString
Byte Array
Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

 

 

256-bit AES Decrypt Hexidecimalized Encrypted String

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

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

Demonstrates how to decrypt a string that was previously encrypted using 256-bit AES encrypted where the result is encoded to a hex string.

    // Decrypt a string using 256-bit AES encryption.  The encrypted
    // data is passed as a hexidecimalized string.
    CkCrypt2 crypt2;
    crypt2.UnlockComponent("anything for 30-day trial");

    crypt2.put_CryptAlgorithm("aes");
    crypt2.put_KeyLength(256);
    crypt2.put_EncodingMode("hex");

    // We are going to call DecryptStringENC which returns a string.
    // If the string that was encrypted was represented in some non-ascii
    // character encoding, we'll need to know about it in order to
    // interpret the characters of the decrypted string correctly.
    // In this case however, the string we are decrypting is us-ascii,
    // so we can leave the Charset alone...
    //crypt2.put_Charset("us-ascii");

    // Generate a binary secret key according to the KeyLength.
    // The SecretKey property is a byte array that can be set
    // directly by passing a byte array equal in bit-length to
    // the KeyLength, or you can let the CkCrypt2 class generate
    // a binary secret key given a password string.
    CkByteData secretKey;
    crypt2.GenerateSecretKey("myPassword",secretKey);
    crypt2.put_SecretKey(secretKey);

    CkString strDecrypted;
    crypt2.DecryptStringENC("4D55BBE6DFA47582EA3BC95D1EA8BBD6",strDecrypted);

    // The output of this example is: "Encrypt This!"
    printf("%s\n",strDecrypted.getString());
    
    // An example of a C# program that creates the encrypted string used
    // in this example is located here: C# 256-bit AES String Encryption

 

 

 

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

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

Mail Component · .NET Mail Component · XML Parser