Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Blowfish and Rails

Thread Tools

Blowfish and Rails

Posts: n/a
I'm working on encrypting some data using blowfish. My Client uses php
and blowfish for encryption and i use ror and blowfish
the php snippet is as follows,

$key = 'some key';
$data = 'data to be encrypted'

$iv = pack('H*', substr($key, 0, 16));

$literak_key =", $key.$key.$key.substr($key,16),";
$cipher = mcrypt_module_open(MCRYPT_BLOWFISH, '', 'cbc', '');
mcrypt_generic_init($cipher, $literalKey, $iv);

When i try to do the same thing using rails, i get a different
encrypted key.

Also, blow fish can take only 56 byte key as its input, so i
manipulated the key as how its done in php and packed it to a hex.

however am not sure how i can pass the iv

blowfish =
encrypted_string = blowfish.encrypt_block(plain_text)

any thoughts? thank you.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
BlowFish decrypting Claus Wanner C++ 2 11-04-2005 01:19 PM
Padding Problem with Blowfish and Crypt::CBC and Java Cipher Hal Vaughan Perl Misc 6 09-05-2005 04:40 PM
Blowfish Advanced CS update Stephen Howard Computer Security 0 02-07-2005 11:40 AM
blowfish vs. twofish - help needed BB Computer Security 2 12-23-2004 06:32 PM
Blowfish hash Java 2 05-26-2004 12:04 PM