Introduction
In today’s digital age, securing sensitive information is paramount. UiPath offers built-in cryptographic activities that allow you to encrypt and decrypt text, ensuring that your data remains secure during automation processes. In this blog post, we will explore how to use the Encrypt Text and Decrypt Text activities in UiPath to enhance your data security.
Table of Contents
- Understanding Cryptography in UiPath
- Setting Up the Encrypt Text Activity
- Setting Up the Decrypt Text Activity
- Practical Example: Encrypting and Decrypting a Password
- Best Practices for Secure Automation
1. Understanding Cryptography in UiPath
Cryptography is the practice of securing information by transforming it into an unreadable format for unauthorized users. UiPath provides cryptographic activities that use advanced encryption standards (AES) to ensure the confidentiality of your data.
2. Setting Up the Encrypt Text Activity
The Encrypt Text activity is used to convert plain text into encrypted text. Here’s how to set it up:
- Drag and Drop the Encrypt Text Activity:
- Open UiPath Studio and drag the Encrypt Text activity into your workflow.
Fig 1: Drag and Drop Encrypt Text Activity

- Configure the Properties:
- In the Properties panel, set the input text that you want to encrypt and specify the encryption key.
Fig 2: Configure Encrypt Text Properties

- Specify the Encryption Key:
- Ensure the key is strong and kept confidential. For example: MyStrongEncryptionKey123.
3. Setting Up the Decrypt Text Activity
The Decrypt Text activity is used to convert encrypted text back into its original plain text form. Here’s how to set it up:
- Drag and Drop the Decrypt Text Activity:
- Drag the Decrypt Text activity into your workflow, ideally after the Encrypt Text activity.
Fig 3: Drag and Drop Decrypt Text Activity

- Configure the Properties:
- In the Properties panel, set the encrypted text as input and use the same encryption key used during encryption.
Fig 4: Configure Decrypt Text Properties

4. Practical Example: Encrypting and Decrypting a Password
Let’s put it all together in a practical example where we encrypt and then decrypt a password.
- Create Variables:
- Create variables for plain text, encrypted text, and decrypted text.
- Encrypt the Password:
- Set the plain text variable to the password you want to encrypt.
- Use the Encrypt Text activity to encrypt this password.
- Store the Encrypted Password:
- Assign the output of the Encrypt Text activity to the encrypted text variable.
- Decrypt the Password:
- Use the Decrypt Text activity to decrypt the encrypted password.
- Assign the output to the decrypted text variable.
- Output the Results:
- Use MessageBox activities to display the original, encrypted, and decrypted texts.
Fig 5: Encrypt Password Workflow and Output


Fig 6: Decrypt Password Workflow and Output


5. Best Practices for Secure Automation
- Strong Encryption Keys:
- Use strong, complex keys for encryption and keep them confidential.
- Key Management:
- Store encryption keys securely and restrict access to them.
- Error Handling:
- Implement robust error handling to manage exceptions during encryption and decryption.
- Logging:
- Avoid logging sensitive information like plain text or encryption keys.
- Regular Audits:
- Regularly audit your automation workflows for potential security vulnerabilities.
Conclusion
Encrypting and decrypting text in UiPath enhances the security of your automation workflows, ensuring sensitive information remains protected. By following these steps and best practices, you can effectively utilize UiPath’s cryptographic activities to safeguard your data.