UiPath encrypted string to decrypt outside UiPath

Hi Experts,

We are working on automation to transfer the data to another team in encrypted format and they decrypt on their end. The other team is using Java so basically decrypt in Java code.
We have used UiPath Cryptography library for all encryption/decryption which works out fine within UiPath but this is the first time, we have requirement to decrypt outside UiPath.
Please let me know if anyone have experience on this type of issue? We are trying to explore any/all options on our end.

In short, How can we decrypt text which was encrypted using UiPath Cryptography activity with AES or DES? if not possible, then we can invoke C# code in UiPath and decrypt in Java.

Thanks.

@AndrewHall @Pablito - tagging UiPath experts, please help us here.

As long as you agree with the team using Java code on which encryption method is being used and are aligned on the options, then Java should have a library with the corresponding decryption support.

Assuming both sides are using standard libraries, encryption/decryption methods are standardized. So you just need to agree with that team standard you are using.

Thanks for your response. It is just that I don’t even know how can that be built with UiPath, is it like add customized code(Invoke Code Activity) encrypt and decrypt outside?

Can you describe the expected flow of encryption/decryption or other scenario requirements?

My initial understanding is that you would need to encrypt a string in UiPath for example, then that string would exit the UiPath Process (e.g. be written into an external system) then a separate Java application would retrieve it and need to decrypt it. Or potentially the other direction (gets encrypted in Java, written somewhere, UiPath Process retrieves it and then needs to decrypt it)?

Is that a correct understanding?

That is correct understanding. For now the flow is one-way only. Encrypt in UiPath and decrypt in Java but going forward it can get two-way encrypt-decrypt as well.
There are no other special requirements.

In terms of how, assuming the team owning the Java code is fine using one of the methods supported by the UiPath automation this shouldn’t be a problem.

For e.g. while different libraries may have different options that need to be matched up, both AES and DES are standards. So any correctly implemented library should be able to decrypt data encrypted in a different system using the same standard.

Hello, I think I can help you, I had the same need 2 weeks ago, I had to decrypt data from outside in Java, with AES256.
UiPath Cryptography activities didn’t work for me also, we tried different ways and algorithms, I think the activities are useful to decrypt if you encrypt also with them.

So first I had to install UiPath.Java.Activities package to be able to execute the code that will decrypt, using Java.
Then I asked Java dev team to publish the .jar file with the decryption method(as they have the encrypt method, they also had the decrypt one to match with the used encryption, so I just used it and execute on UiPath).
To execute the method inside the .jar file, you will end up with something like this on your project:

On Invoke Java Method, the parameters property, you need to provide the parameters for Java function (like the encrypted text) in the order that shows on the Java method

You will need to have Java installed on the machine.
If you have questions, don’t hesitate to ask.