Hi @dla0313,
Merging duplicate topics to one.
Lets recap.
You have a datatable and want to encrypt one or more column in the datatable. In the approach I showed in this thread, it is a stripped down version. When you are working with datatables from databases, you will need to improvise the approach in two ways (An alternative to encrypting or decrypting column values of a datatable?)
-
You have to ensure that the column of the datatable is not limited as to the string count (this is because when you encrypt your encrypted string can be much larger than the original string depending on the type of the encryption used)
-
Null values in the column is very easy to neglect, all you do is to tell that when there are null values skip encryption
row.Item(item).ToString.IsNullOrEmpty
-
Here is the approach we use on our dispatchers EncryptDTColumns.xaml (was written in windows legacy, but should open in windows projects) -
EncryptDTColumns.xaml (23.7 KB)
If you are wondering what the boiler plate in the workflow signifies, you can read this tutorial : Creating error-proof reusable workflows in UiPath - News / Tutorials - UiPath Community Forum
We specify which columns to encrypt in an input array format, we also provide our encryption key and let this workflow perform the encryption
The inout_DataTableToEncrypt
will have the columns encrypted.
For performer, we use the same logic, but instead of Encryption we use the Decryption activity from official Cryptography Library. One caveat is that the official encrypt text activity does not take SecureString rather plain text of your encryption key. This is one of the risks using this approach. Encryption key itself wont be encrypted, an oxymoron!
Hopes this helps you understand why the error was persistent and how two solve it.
Also please avoid posting duplicate posts on the same topic, this is a bad practice in any forum and only decreases your chances to resolve the query sooner.