Class AesCrypt() Professional

Class function of the AesCrypt class


The AesCrypt class provides the interface for AES encryption/decryption. Its role is to provide a cryptographic implementation of AES, the Advanced Encryption Standard as announced by NIST, effective May 26 2002. It is derived from the class CryptProvider. This class is not yet documented because it is an abstract, which cannot be instantiated.

AES uses the Rijndael algorithm to encrypt/decrypt data. It is a block code.

The current implementation supports a block length of 16 byte, and key lengths of 128, 192 or 256 bit.

SecureKey():destroy() can be called right after setting the key object, either after :new() or :setKey().

Class methods
Creates an instance of the AesCrypt class.
Encrypts a buffer using a key.
Decrypts a previously encrypted buffer using a key.
Prepares a buffer for encryption.
Provides a key used for encryption or decryption.
AesCrypt handling
// In this example, AesCrypt() is used 
// to encrypt a single buffer 

#include "" 

   LOCAL oAes 
   LOCAL oKey 
   LOCAL cResult 

   // generate a key and print out 
   oKey := SecureKey():generate() 
   ? oKey:toString() 

   // create AesCrypt()-instance using the key 
   oAes := AesCrypt():new(oKey) 

   // destroy key value 

   // prepare input buffer length 
   // encrypt buffer 
   cResult := oAes:encrypt(cBuffer) 
   ? cResult 

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.