Hash File
AutomatR.DefaultActivities.Cryptography.HashFile
The "Hash File" activity in AutomatR is part of the Cryptography activities package, enabling users to apply selected hashing algorithms to the contents of a provided file and obtain the resulting hash as a hexadecimal string representation. This activity enhances security measures and facilitates hash generation within automation workflows.
Properties
Name | Description |
---|---|
Input | |
Algorithm | Selects the hashing algorithm to be applied to the file contents. Choose from available options such as MD5, RIPEMD160, SHA1, SHA256, SHA384, and SHA512. Enum variables containing the desired algorithm. |
File Path | Specifies the full path of the file to be hashed. String variables containing the file path. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Hash File" 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 hashed file 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" activity onto the workflow.
- Configure the properties by selecting the hashing algorithm and specifying the file path.
- Optionally, configure the delay.
- Execute the workflow to obtain the hash of the specified file.
Example: Consider an example where the "Hash File" activity is used to hash a file named "document.txt" using the SHA256 algorithm:
Hash File:
Algorithm: SHA256
File Path: "D:\\files\\document.txt"
Result: hashedResult
In this example, the activity applies the SHA256 algorithm 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 hashing 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 Hashing Algorithms
- MD5: Provides a 32-character hexadecimal number.
- RIPEMD160: Produces a 40-character hexadecimal string.
- SHA1: Generates a 40-character hexadecimal hash.
- SHA256: Results in a 64-character hexadecimal hash.
- SHA384: Produces a 96-character hexadecimal string.
- SHA512: Generates a 128-character hexadecimal hash.