# Blowfish crypt in rails app

**URL:** <https://www.ruby-forum.com/t/blowfish-crypt-in-rails-app/175768>\
**Category:** Rails\
**Created:** [September 19, 2009, 7:55am UTC](https://www.ruby-forum.com/t/blowfish-crypt-in-rails-app/175768 "2009-09-19T07:55:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahesh\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@mahesh\_s](https://www.ruby-forum.com/u/mahesh_s)\
**Post date:** [September 19, 2009, 7:55am UTC](https://www.ruby-forum.com/t/blowfish-crypt-in-rails-app/175768/1 "2009-09-19T07:55:28Z")

</div>

HI

```
Im creating a rails app using blowfish encryption and decryption, 

```

in my  
app i have included a gem crypt for doing a encryption and im trying to  
decrypt the result using blowfish.js  
is that possible to do that encryption via ruby gem and decryption via  
blowfish.js, i download the blowfish js from the url:  
[http://dren.ch/js/blowfish.js](http://dren.ch/js/blowfish.js)

Is it possible to implement encryption via ruby decryption via js? .

---

<div class="post-metadata">

**Author:** ![mahesh\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@mahesh\_s](https://www.ruby-forum.com/u/mahesh_s)\
**Post date:** [September 19, 2009, 4:32pm UTC](https://www.ruby-forum.com/t/blowfish-crypt-in-rails-app/175768/2 "2009-09-19T16:32:53Z")

</div>

On Sep 19, 2009, at 1:53 AM, mahesh s wrote:

> HI
> 
> ```
> Im creating a rails app using blowfish encryption and  
> 
> ```
> 
> decryption, in my app i have included a gem crypt for doing a  
> encryption and im trying to decrypt the result using blowfish.js  
> is that possible to do that encryption via ruby gem and decryption  
> via blowfish.js, i download the blowfish js from the url:[http://dren.ch/js/blowfish.js](http://dren.ch/js/blowfish.js)
> 
> Is it possible to implement encryption via ruby decryption via js? .

Yes. (Assuming that the algorithms are correctly implemented, of  
course.)

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![mahesh\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@mahesh\_s](https://www.ruby-forum.com/u/mahesh_s)\
**Post date:** [September 21, 2009, 8:36am UTC](https://www.ruby-forum.com/t/blowfish-crypt-in-rails-app/175768/3 "2009-09-21T08:36:48Z")

</div>

Thank u guys i will try for that

On Sun, Sep 20, 2009 at 10:41 PM, Robert W. \<

---

<div class="post-metadata">

**Author:** ![mahesh\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@mahesh\_s](https://www.ruby-forum.com/u/mahesh_s)\
**Post date:** [September 20, 2009, 7:11pm UTC](https://www.ruby-forum.com/t/blowfish-crypt-in-rails-app/175768/4 "2009-09-20T19:11:41Z")

</div>

Rob B. wrote:

> Yes. (Assuming that the algorithms are correctly implemented, of  
> course.)

You will also have to make sure you’re using the exact same algorithm on  
both sides.

For example OpenSSL on Mac OS X 10.6 contains the following blowfish  
ciphers:  
bf  
bf-cbc  
bf-cfb  
bf-ecb  
bf-ofb

You will need to determine which of these your blowfish.js file is using  
and match that in your Ruby Code.
