EncryptFile

Estimated reading: 5 minutes 1749 views

This activity allows users to easily encrypt files by selecting a key encoding and encryption algorithm.

Properties

INPUT

Algorithm: This parameter indicates to choose the algorithm type from the drop-down menu that is used to encrypt the file based on it.

1. AES(Deprecated)
2. AES GCM
3. DES (Deprecated)
4. RC2 (Non-FIPS) (Deprecated)
5. Rijndael (Non-FIPS) (Dperecated)
6. Triple DES.

Refer to the documentation below to view the types of algorithms.
By default, the activity recommends the most commonly used type, “AES GCM”.

DelayAfter: It assists the user to add a delay before initiating subsequent activities. The delay duration here is in milliseconds. By default, it is set to “1000” milliseconds.
When the option is left blank, the delay will not be considered.

DelayBefore: It assists the user in adding a delay before starting the execution of the activities. The delay duration here is in milliseconds. By default, it is set to “1000” milliseconds.
When the option is left blank, the delay will not be considered.

Input File path*: This parameter indicates to provide the input path of the file which needs to be encrypted.

This parameter accepts the values in “String” datatype. You can either hardcode the values in “String” format or can provide the variable in “String” datatype.

Key Encoding: It assists the user to choose the key encoding type from the drop-down menu that is used to perform the encryption algorithm.

Click here to refer the documentation to view the types of key encoding.

By default, the activity recommends the most commonly used type, “Unicode UTF-8”.

Overwrite: Check this box if you want to overwrite a file if the specified output file path is already in use.

By default, it is unchecked.

Secret Key*: This parameter indicates to provide the key which is used by algorithm chosen to encrypt as well as decrypt the file.

This field accepts values in “String” datatype. You can either hardcode the values in “String” format or can provide the variable in “String” datatype.

MISC

DisplayName: Displays the name of the activity. The activity name can be customized, which aids in troubleshooting.

SkipOnError: Specify the “Boolean” value as “True” or “False.”

True: Continue executing the workflow regardless of any errors thrown.
False: Halt the workflow if it encounters any errors.
None: If the option is left blank, the activity will, by default, behave as if “False” were chosen.

Version: It indicates the version of the feature being used.

OUTPUT

Output File Path*It assists the user to provide the file path where the encrypted file needs to be saved in the system. 

This field returns values in “String” datatype. You can either hardcode the values in “String” format or can provide the variable in “String” datatype.

Result: It provides the ability to view the execution status of the activity. It returns values in “Boolean.”

True: Indicates that the activity has been executed successfully without any errors.
False: Indicates that the activity has been unsuccessful due to an unexpected error being thrown.

Represents mandatory fields to execute the workflow.

Types of Algorithms

The following algorithms are used to encrypt your data (file or text). Each offers different capabilities and encryption methods. You can choose any of these options in the activity.

AES GCM (Advanced Encryption Standard Galois/Counter Mode):

1. Combines AES encryption with Galois/Counter Mode (GCM), providing both data confidentiality (encryption) and data integrity (authentication).
2. Known for its strong security and efficiency. The secret key length must be 16 characters.

DES (Deprecated) (Data Encryption Standard):

1. An older symmetric encryption algorithm that is no longer recommended due to its short key length, making it vulnerable to brute-force attacks.
2. Operates on blocks of data and has been largely replaced by more secure algorithms like AES. The secret key length must be 8 characters.

RC2 (Non-FIPS) (Deprecated):

1. A symmetric encryption algorithm that is not compliant with Federal Information Processing Standards (FIPS) and has been deprecated due to security concerns.
2. Uses variable key lengths and operates on blocks of data. Its use has declined in favor of more secure alternatives. The secret key length must be 5 characters.

Rijndael (Non-FIPS) (Deprecated):

1. This algorithm became AES (Advanced Encryption Standard) after winning a competition for a new encryption standard.
2. The non-FIPS version refers to variations of Rijndael that do not comply with Federal Information Processing Standards. Its use has decreased in favor of AES and other modern algorithms. The secret key length must be 16 characters.

TripleDES (Triple Data Encryption Standard):

1. Applies the DES encryption algorithm three times in succession to enhance security by increasing the key length.
2. While more secure than DES, it has been surpassed by modern algorithms like AES. The secret key length must be 24 characters.

Here’s an example of how to use the activity in a workflow:

In this example, I’ll automate a simple workflow using the “Encrypt File” activity to encrypt a sample image file.

Steps to build the bot:

1. Create a new solution.
2. Install the “CryptographyAutomation” from the Manage Features menu.
3. Add the “EncryptFile” activity to the workflow and set it as the starting node.
a. Double-click on the activity to enter the necessary details.
b. For this example, use the default algorithm type (AES GCM).
c. Navigate to the “Input File Path” in the properties section and provide the input file path.
d. Next, go to the “Secret Key” section and enter a random value to serve as the key for encrypting file. For example, use “ABC123456789FILE” as the key.
4. Keep all other settings at their default values.
5. Move to the “Output File Path” in the properties section to determine where your encrypted file will be saved.
a. Specify the directory path as
Environment.GetFolderPath(Environment.SpecialFolder.Desktop).
b. This command fetches the desktop path for the current user, providing a location to store the encrypted file.
6. Now, save the workflow and execute.

The encrypted file will be stored in the specified directory path. To learn more about decrypting the file in detail, click here.

Share this Doc

EncryptFile

Or copy link

CONTENTS