215
Views
6
Comments
Solved
Decryption
Application Type
Reactive

here,my problem is to be i want to decrypt json data which is to encrypted in another machine he giving the key and value i want to decrypt that and store in to database it is in json format can u plz suggest how can acheive ,Here my team member encrpyt tha data in his sysytem (using express js) now he is sending tha data to my outsystems server where he is sending value now i want to decrypt is it possible if how can acheive 

2022-08-03 04-32-50
Ravi Punjwani
Solution

Hi Pydisetti,

Share a sample of encrypted data and the key used to encrypt it. I'll send you a sample oml to show how you can decrypt it.

UserImage.jpg
Pydisetti sai

rsa algorthim

private key:  MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAISyhHTo2Im5f1TrhJ8Ki6i6vuuXCfYAR4gHaZpd1F8WkDANyDI0/D9BIpq3mfSAXf2YonuJqWPtLVKqNpMqe/THN4od83ZqbHE1ocejde/7mFWu+qnUzcnA1HpTnF4k/sLOv9MXlAAXTGRnzsFcSIDg+++oDsTBHn4IcHZurvwtAgMBAAECgYA8SqQ2PkmMohTBr9TtMixseJUgk9q5xDy8CKopsjI5FhZjTw/ECCEIWH7xjzRLTDvoan6A5PZq6aurIJ11VltFF1kx69DVX93d9CUQAlsCT4YmoLolBmejWj6WwNiSqg8TJBlx9CNHiOaLh0e6XXf4aZY5ksQs3ZZsw0eUY6L7gQJBAP2oLDG3S+vUq23PSbRJlmWQb0Xq9ym9OL9FI052bM4m3JaWonRBkkpA67jXriSriBxvHXPVHK9+tr2gHwxIQw0CQQCF7E8v4VWjVdvtTCZvwxIucFIgUnC/mz3y/PRqJVHAeKYVHQ8PjPY0BZiHdWfslQma37BDHig4qWVSFYsaf9WhAkEA62xcqD/xTQ5zlVVgmN37ooQtYn0zrR+cPZnTrQ0o6yUScwmX+cKqHhSnM0WqsQorKAjREyLmntNClDi62FFxOQJAfLm0ljcaduBDzyEYuwXGLRHWqtucvhZq/56uUx0moka7BvblS+pQceq0P5QMkb3MED07/4Zal0rMXkJKJwffgQJBAOKIB8h8Bzc3h2kifywa9O3WZY2WeiRFuSC08w+D8WNYkIniRAdutI42rzNRybbBoZJtRd6/MJpDukuPjLLasK4=

Encrypted output: eVoe/REGzXttjDpC6IfEm3DaZjrBvnZzZCvSoZt929Cq73figKokNOlIiQImXt97YvGg3ydt+PT9bqTKY6i5DjJNDi5R6YN8XKNt64ZaRzpBJos5C+vKujE0BTh3wlYus3xOqcOHSv0O+Mqmz3zBWgGF6Jnj3bEzaDW8pHOOrK0=


UserImage.jpg
Pydisetti sai

thank you so much sir for doing this help

2022-08-03 04-32-50
Ravi Punjwani

Hi Pydisetti,

Can you ask them to share the private key file in PEM format instead of encrypted private key.

UserImage.jpg
Pydisetti sai

Sorry for delay he is not doing pem format he just giving data can u plz share how to achieve it like with sample json data that data should be stroed in db


2024-09-04 05-41-42
Pratap Singh Naruka
Solution

Hi @Pydisetti 


So In outsystems we use CryptoAPI component to Encrypt-decrypt the data from plain text.Here both (Encrypt-decrypt ) shoud be done by same componenent so it's deiffcult to understand through which your teammembers are encrypting the data.Moreover this might usefull for you- https://success.outsystems.com/Documentation/Best_Practices/Security/Securing_data_at_rest_with_encryption

In OutSystems, you can use the built-in "AES256Decrypt" action to decrypt data received from an API. 
You can use forge component CryptoAPI for this
You have RES and AES methods for encryption for which server actions are provided so you can use those for decryption process. Here site.SavedKey means key which provioded to you.In your case if it has been provided to you then you can paste it directly to SavedKey 

Another one is to be that json data i want to store in db based on parameters how can we achieve this --

To achieve your goals (store json to database entity):

1. You need to deserialize the json into correct data type.

Your json is an array of object.

So your data type should be list of record.


2. your json is now is in a local variable (list of record), you need to iterate (loop) each of record before saving to entity...

To iterate you need For-Each node, like in below picture.

After For-Each you can pass that JSON.List.Current.Record to Create Action.


With Regards 
Pratap Singh

2022-08-03 04-32-50
Ravi Punjwani
Solution

Hi Pydisetti,

Share a sample of encrypted data and the key used to encrypt it. I'll send you a sample oml to show how you can decrypt it.

UserImage.jpg
Pydisetti sai

rsa algorthim

private key:  MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAISyhHTo2Im5f1TrhJ8Ki6i6vuuXCfYAR4gHaZpd1F8WkDANyDI0/D9BIpq3mfSAXf2YonuJqWPtLVKqNpMqe/THN4od83ZqbHE1ocejde/7mFWu+qnUzcnA1HpTnF4k/sLOv9MXlAAXTGRnzsFcSIDg+++oDsTBHn4IcHZurvwtAgMBAAECgYA8SqQ2PkmMohTBr9TtMixseJUgk9q5xDy8CKopsjI5FhZjTw/ECCEIWH7xjzRLTDvoan6A5PZq6aurIJ11VltFF1kx69DVX93d9CUQAlsCT4YmoLolBmejWj6WwNiSqg8TJBlx9CNHiOaLh0e6XXf4aZY5ksQs3ZZsw0eUY6L7gQJBAP2oLDG3S+vUq23PSbRJlmWQb0Xq9ym9OL9FI052bM4m3JaWonRBkkpA67jXriSriBxvHXPVHK9+tr2gHwxIQw0CQQCF7E8v4VWjVdvtTCZvwxIucFIgUnC/mz3y/PRqJVHAeKYVHQ8PjPY0BZiHdWfslQma37BDHig4qWVSFYsaf9WhAkEA62xcqD/xTQ5zlVVgmN37ooQtYn0zrR+cPZnTrQ0o6yUScwmX+cKqHhSnM0WqsQorKAjREyLmntNClDi62FFxOQJAfLm0ljcaduBDzyEYuwXGLRHWqtucvhZq/56uUx0moka7BvblS+pQceq0P5QMkb3MED07/4Zal0rMXkJKJwffgQJBAOKIB8h8Bzc3h2kifywa9O3WZY2WeiRFuSC08w+D8WNYkIniRAdutI42rzNRybbBoZJtRd6/MJpDukuPjLLasK4=

Encrypted output: eVoe/REGzXttjDpC6IfEm3DaZjrBvnZzZCvSoZt929Cq73figKokNOlIiQImXt97YvGg3ydt+PT9bqTKY6i5DjJNDi5R6YN8XKNt64ZaRzpBJos5C+vKujE0BTh3wlYus3xOqcOHSv0O+Mqmz3zBWgGF6Jnj3bEzaDW8pHOOrK0=


UserImage.jpg
Pydisetti sai

thank you so much sir for doing this help

2022-08-03 04-32-50
Ravi Punjwani

Hi Pydisetti,

Can you ask them to share the private key file in PEM format instead of encrypted private key.

UserImage.jpg
Pydisetti sai

Sorry for delay he is not doing pem format he just giving data can u plz share how to achieve it like with sample json data that data should be stroed in db


2024-09-04 05-41-42
Pratap Singh Naruka
Solution

Hi @Pydisetti 


So In outsystems we use CryptoAPI component to Encrypt-decrypt the data from plain text.Here both (Encrypt-decrypt ) shoud be done by same componenent so it's deiffcult to understand through which your teammembers are encrypting the data.Moreover this might usefull for you- https://success.outsystems.com/Documentation/Best_Practices/Security/Securing_data_at_rest_with_encryption

In OutSystems, you can use the built-in "AES256Decrypt" action to decrypt data received from an API. 
You can use forge component CryptoAPI for this
You have RES and AES methods for encryption for which server actions are provided so you can use those for decryption process. Here site.SavedKey means key which provioded to you.In your case if it has been provided to you then you can paste it directly to SavedKey 

Another one is to be that json data i want to store in db based on parameters how can we achieve this --

To achieve your goals (store json to database entity):

1. You need to deserialize the json into correct data type.

Your json is an array of object.

So your data type should be list of record.


2. your json is now is in a local variable (list of record), you need to iterate (loop) each of record before saving to entity...

To iterate you need For-Each node, like in below picture.

After For-Each you can pass that JSON.List.Current.Record to Create Action.


With Regards 
Pratap Singh

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.