Encryption
Example
An example workflow is presented for each function described below. All workflows are included in a sample project.
To view the sample project:
-
Download the ZIP file of the sample project here.
-
Copy the unzipped files to the folder%AppData%/Nice_Systems/AutomationStudio/Projects or any other folder.
-
Open the project Encryption in Automation Studio. Each workflow is named with the name of the function it demonstrates.
Functions
Decrypts text that was encrypted using Encrypt Text using the same session-generated key. Text encrypted using Encrypt Text can only be decrypted during the same session as when it was encrypted.
Parameters
|
Parameter |
Input Type |
Description |
|---|---|---|
|
text |
text |
The text to decrypt |
Returns
Returns text
Example
This example is continued from the example under Encrypt Text.
The second step in this workflow decrypts the text stored in the variable encrypted_text and stores the decrypted text in the variable decrypted_text.
When executed, the decrypted text is written to the variable decrypted_text.
Decrypts specified text that was encrypted using an encryption key.
Parameters
|
Parameter |
Input Type |
Description |
|---|---|---|
|
text |
text |
The text to decrypt |
| key | text |
The encryption key to use The key must be at least 6 characters long. |
Returns
Returns text.
Example
This example is continued from the example under Encrypt Text with Key,
This workflow decrypts the text located in a file using the key sunShine($ and writes the decrypted text to the variable decrypted_text.
When executed, the value of the variable decrypted_text remains blank. That is because the key used was incorrect.
When the key is set correctly to mY-umbrella! and the workflow is executed, the variable decrypted_text is populated with the decrypted text.
URL encodes specified text so that it can be transmitted over the Internet. Non-ASCII characters are converted using percentage encoding.
Note that spaces are converted to + and not to %20.
Parameters
|
Parameter |
Input Type |
Description |
|---|---|---|
|
text |
text |
The text to URL encode |
|
encoding type |
Text |
The name of the encoding of the text provided, for example UTF-8 or EUC-CN. For a full list of supported encoding type names, see Microsoft .NET documentation. |
Returns
Returns text.
Example
This workflow encodes the text john & mary smith (which uses UTF-8 encoding) to a URL encoded format and stores the encoded text in the variable encoded_text.
When executed, the variable encoded_textis populated with URL encoded text.
Encrypts specified text using a session-generated key.
Parameters
|
Parameter |
Input Type |
Description |
|---|---|---|
|
text |
text |
The text to encrypt |
Returns
Returns text.
Example
The first step of this workflow encrypts the text this is my secret and stores the encrypted text in the variable encrypted_text.
When executed, the variable encrypted_text is populated with the encrypted text.
This example is continued in the example under Decrypt Text.
Encrypts specified text using the specified key.
Parameters
|
Parameter |
Input Type |
Description |
|---|---|---|
|
text |
text |
The text to encrypt |
| key | text |
The encryption key to use The key must be at least 6 characters long. |
Returns
Returns text.
Example
This workflow encrypts the text this is my secret using the key mY-umbrella! and writes the encrypted text to a file.
When executed, the encrypted text is written to the specified file.
This example is continued in the example under Decrypt Text with Key,
