Forum: Ruby on Rails encrypting data using Blowfish/cbc

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
3da4ed7ea16825fead6120d70dc7da43?d=identicon&s=25 JSeidel (Guest)
on 2007-04-03 02:05
(Received via mailing list)
I need to encrypt/decrypt some data in my application. I downloaded and installed it successfully. But when I run a simple
test program, I get the following error:

`encrypt_stream': undefined method `write' for "":String
        from testcrypt.rb:8

Program is very simple:

require 'crypt/blowfish'
tkey = '12345'
tblow =
testblock = 'abcdeft12345'
testcrypt = ''
puts testblock, testdecrypt

Crypt::Blowfihs mixes in Crypt::CBC which requires 'stringio', which
is where I'm guessing the write method should be.

Any pointers as to what I'm doing wrong here?

Thanks much...jon
3da4ed7ea16825fead6120d70dc7da43?d=identicon&s=25 JSeidel (Guest)
on 2007-05-06 02:18
(Received via mailing list)
That means it's expecting 'stream' access, while you're passing it a
string -- I ran into the same problem, researched it, and finally gave

Now I use Pelle Braendgaard's EzCrypto module:
  gem install ezcrypto

This topic is locked and can not be replied to.