The Crypto Homepage provides the link to the Crypto User Guide. This guide belongs to the information you have to see, but unfortunately, this is the only guide to find: (. User Guide has some examples, where The description of the AES usage is not very straightforward, and the AES's symmetric encryption algorithm is more common, so I wrote an example of AES here. The example is to encrypt a block directly, AES's data block size is 128 bits, key The length can be selected for 128 bits, 192 or 256. It is very useful to encrypt a block directly, because we usually have data encrypted with any length, need to select encryption mode such as CFB. But directly block encryption is the foundation of symmetrical encryption. .
#include
AESDECRYPTOR.SETKEY (AESKEY, AES :: Default_KeyLength); Aesdecryptor.ProcessandXorblock (Outblock, XORBLOCK, PLAINTEXT); for (int i = 0; i <16; i ) {cout << plaintext [i];} cout << Endl Return 0;} There are several places to pay attention to this: AES is not a class, but a TypedEf of the class Rijndael. Although Rijndael is a class, its usage and namespace are very similar to those who have no member functions and member variables, just define a series of categories and data types (Enum), which can really encrypt the decrypted AESencryption and AesDecryption. They are all defined in this class. AESENCRYPTION and AESDECryption In addition to the setKey () function setting key, the key, parameters, and setKey () are set in the constructor. Processandxorblock () may make people more confused, the function name means ProcessBlock and xorblock, ProcessBlock is encrypted or decrypted with blocks, XORBLock is useful in various encryption mode, here we do not need application mode, so use to XOR operation XORBLOCK is set to 0, then xor operation does not work.