I am trying to encrypt only certain columns in a data table. Those columns will have null values sometimes so the encryption activity throws an error when its null. How do I do fix this issue? I can’t encrypt the entire table due to requirements.
I think null value (empty value) cannot be encrypted. How about to create rule such as add random 3 characters at the beginning of the string just before encryption and remove the first 3 character from decrypted result?
I keep receiving an error when I try to encrypt in a for each loop. I am trying to follow what is being done in this image. But I get an error on the Text part: row(item).ToString . The error says “Overload resolution failed because no accessible ‘Item’ can be called within these arguments…”
I tried that, but now the Assign activity is throwing an error saying “Exception has been thrown by the target of an invocation.”
I think this is due to the length of the column but I don’t know how to increase it as I am just extracting the values for that data table from a database. What do I do now?
As the title mentions, I am having lots of issues with encrypting only specific columns in a data table. Unfortunately, I can’t encrypt the entire table due to certain requirements. I keep receiving an error saying “Exception has been thrown by a target of an invocation” so I’m not sure exactly how to resolve this. I tried following the EncryptColumValuesCurrentApproach.xaml in this discussion post (An alternative to encrypting or decrypting column values of a datatable?).
Unfortunately none of these options seem to be working for me as my data table is being extracted from a database so the column structure is automatically assigned. I also tried to clone the table into a new one and assign all the values to a string, but that didn’t work either. Please help!
Could you also maybe provide the project.json file that was tagged to the xaml? It will help us to quickly identify the issue with the activities also directly troubleshoot the issue at hand as the compatibilities would be in place.
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)
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.