Hash File Key
AutomatR.DefaultActivities.Cryptography.HashFileKey
The "Hash File Key" activity in AutomatR is part of the Cryptography activities package, allowing users to hash a file using a key with a specified algorithm and encoding format. The resulting hash is obtained as a hexadecimal string representation. This activity enhances security measures by incorporating a key into the hashing process within automation workflows.
Properties
Name | Description |
---|---|
Input | |
Algorithm | Selects the HMAC algorithm to be applied to the file contents using the provided key. Choose from available options such as HMACMD5, HMACSHA1, HMACSHA256, HMACSHA384, HMACSHA512, and HMACRIPEMD160. Enum variables containing the desired algorithm. |
File Path | Specifies the full path of the file to be hashed using the provided key. String variables containing the file path. |
Key | Provides the key to be used for hashing the specified file. This field only accepts strings and String variables. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Hash File Key" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
Output | |
Result | Outputs the result of the hashed file key stored as a hexadecimal string. String variables to store the hash result for utilization in subsequent activities. |
How to use:
- Drag and drop the "Hash File Key" activity onto the workflow.
- Configure the properties by selecting the HMAC algorithm, specifying the file path, and providing the key.
- Optionally, configure the delay.
- Execute the workflow to obtain the hash of the specified file using the provided key.
Example: Consider an example where the "Hash File Key" activity is used to hash a file named "document.txt" using the HMACSHA256 algorithm with a provided key:
Hash File Key:
Algorithm: HMACSHA256
File Path: "D:\\files\\document.txt"
Key: "SecretKey123"
Result: hashedResult
In this example, the activity applies the HMACSHA256 algorithm using the key "SecretKey123" to hash the contents of the "document.txt" file, and the resulting hash is stored in the string variable "hashedResult" for further use in the workflow.
Note:
- Ensure that the specified file path is valid and accessible.
- The activity supports various HMAC algorithms, allowing users to choose the most suitable one for their security requirements.
Exceptions:
- If the specified file is open by another application, the activity throws an exception indicating that the file is locked.
Supported HMAC Algorithms
- HMACMD5: Produces a 32-character hexadecimal hash.
- HMACSHA1: Generates a 40-character hexadecimal hash.
- HMACSHA256: Results in a 64-character hexadecimal hash.
- HMACSHA384: Produces a 96-character hexadecimal hash.
- HMACSHA512: Generates a 128-character hexadecimal hash.
- HMACRIPEMD160: Produces a 40-character hexadecimal hash.