# How to decrypt .net API response in rails app?

**URL:** <https://www.ruby-forum.com/t/how-to-decrypt-net-api-response-in-rails-app/238888>\
**Category:** Rails\
**Created:** [February 3, 2014, 7:24am UTC](https://www.ruby-forum.com/t/how-to-decrypt-net-api-response-in-rails-app/238888 "2014-02-03T07:24:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [February 3, 2014, 7:24am UTC](https://www.ruby-forum.com/t/how-to-decrypt-net-api-response-in-rails-app/238888/1 "2014-02-03T07:24:45Z")

</div>

Hello folks,

I am using .net API and response of API is in encrypted form. Please let  
me  
know how should I proceed to do decryption.

Thanks! in advance.

Best Regards  
Fahim Babar Patel

---

<div class="post-metadata">

**Author:** ![fahim\_patel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c89c15/32.png) [@fahim\_patel](https://www.ruby-forum.com/u/fahim_patel)\
**Post date:** [February 3, 2014, 12:03pm UTC](https://www.ruby-forum.com/t/how-to-decrypt-net-api-response-in-rails-app/238888/2 "2014-02-03T12:03:20Z")

</div>

If you have decryption keys then write an helper function using  
bcrypt-ruby  
lib’s general crypto algorithms. Also don’t store keys in source code  
but  
in environment.

Best  
Arun

---

<div class="post-metadata">

**Author:** ![fahim\_patel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c89c15/32.png) [@fahim\_patel](https://www.ruby-forum.com/u/fahim_patel)\
**Post date:** [February 3, 2014, 1:21pm UTC](https://www.ruby-forum.com/t/how-to-decrypt-net-api-response-in-rails-app/238888/3 "2014-02-03T13:21:36Z")

</div>

On Monday, February 3, 2014 6:23:24 AM UTC, Fahim P. wrote:

> Hello folks,
> 
> I am using .net API and response of API is in encrypted form. Please let  
> me know how should I proceed to do decryption.

Well the specifics will depend on how the response was encrypted, but  
ruby’s openssl library contains most of the raw crypto stuff you’re  
likely  
to need. There are also some higher level libraries that are supposed to  
be  
easier to work with (eg ezcrypto) although I’m not very familiar with  
these.

Fred

---

<div class="post-metadata">

**Author:** ![fahim\_patel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c89c15/32.png) [@fahim\_patel](https://www.ruby-forum.com/u/fahim_patel)\
**Post date:** [February 3, 2014, 4:09pm UTC](https://www.ruby-forum.com/t/how-to-decrypt-net-api-response-in-rails-app/238888/4 "2014-02-03T16:09:49Z")

</div>

Thanks all for reply.

API team is not going to provide any information but they said following  
things will resolve our issue:-

1. Create an encryption DLL and add it to the SoapExtension section
2. Tell clients to purchase SSL certificate otherwise the data that is  
being transferred will be ‘in the clear’
3. 

```
 Create your own SSL certificate and install on client’s computer

```

SSL certificate sound good. I am using “savon 2”.
