Encrypt and decrypt data with TripleDES, successor to the DES encryption algorithm.
The TripleDES component is used to encrypt and decrypt data with TripleDES, successor to the DES encryption algorithm.
To begin simply specify the data you wish to encrypt or decrypt.
Input and Output Properties
The class will determine the source and destination of the input and output based on which properties are set.
The order in which the input properties are checked is as follows:
When a valid source is found the search stops. The order in which the output properties are checked is as follows:
- output_message: The output data is written to this property if no other destination is specified.
Before encrypting you must have a valid key and iv. There are a few options available to you in regards to key management. The easiest option is to simply set key_password. When key_password is set the component will automatically create a key and iv using the PKCS5 password digest algorithm. This means there is only one value you need to keep track of.
A simple example:
Component.InputFile = "C:\MyFile.txt"; Component.OutputFile = "C:\Encrypted.txt"; Component.KeyPassword = "password"; Component.Encrypt();
Note that by default the component uses a key size of 192. You may specify the key size (such as 128 or 168) by setting KeySize.
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
|cipher_mode||The cipher mode of operation.|
|input_file||The file to process.|
|input_message||The message to process.|
|iv||The initialization vector (IV).|
|key||The secret key for the symmetric algorithm.|
|key_password||A password to generate the Key and IV .|
|output_file||The output file when encrypting or decrypting.|
|output_message||The output message after processing.|
|overwrite||Indicates whether or not the class should overwrite files.|
|padding_mode||The padding mode.|
|use_hex||Whether input or output is hex encoded.|
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
|config||Sets or retrieves a configuration setting.|
|decrypt||Decrypts the data.|
|decrypt_block||Decrypts a block and returns the decrypted data.|
|encrypt||Encrypts the data.|
|encrypt_block||Encrypts data and returns the encrypted block.|
|reset||Resets the class.|
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
|on_error||Information about errors during data delivery.|
|on_progress||Fired as progress is made.|
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
|BlockSize||The block size, in bits, of the cryptographic operation.|
|IncludeIV||Whether to prepend the IV to the output data and read the IV from the input data.|
|KeyPasswordAlgorithm||The hash algorithm used to derive the Key and IV from the KeyPassword property.|
|KeyPasswordIterations||The number of iterations performed when using KeyPassword to derive the Key and IV.|
|KeyPasswordSalt||The salt value used in conjunction with the KeyPassword to derive the Key and IV.|
|KeySize||The size, in bits, of secret key for the symmetric algorithm.|
|BuildInfo||Information about the product's build.|
|CodePage||The system code page used for Unicode to Multibyte translations.|
|LicenseInfo||Information about the current license.|
|ProcessIdleEvents||Whether the class uses its internal event loop to process events when the main thread is idle.|
|SelectWaitMillis||The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.|
|UseInternalSecurityAPI||Tells the class whether or not to use the system security libraries or an internal implementation.|