From: Nathan Taylor-Hoover Date: 2007-06-15T01:02:55+09:00 Subject: Re: ezcrypto ------=_Part_43608_21091189.1181836975830 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline The manual actually sucks, but I would still recommend joining the ezcrypto mailing list. I think we are seeing the same reoccuring problem with crypo libraries on this mailing list and that is the fact that you MUST specify exactly which cipher mode to use. Most of the crypto libraries just wrap openssl and alot of the default cipher modes they use only operate on binary data in specific sized chunks. http://openssl.org/docs/crypto/blowfish.html# - Nathan On 6/14/07, Jason Roelofs wrote: > > And you are posting this to Ruby-lang why? Sounds like you didn't even try > to contact the author of EzCrypto. > > http://ezcrypto.rubyforge.org/ > > And too bad, I'm going to tell you to RTFM. I checked it out (I have no > prior knowledge of this library) and I think I already know what's wrong > with your code: > > Key#new: > "Initialize the key with raw unencoded binary key data. This needs to be > at > least 16 bytes long for the default aes-128 algorithm." > > It wants "raw binary key data". A Ruby string is not "raw binary key > data". > > Otherwise, I was unable to get it working with blowfish or aes-128-cbc, so > either go get a hold of the author and ask, try to fix the problem > yourself, > or assume that the library is broken (it was released in Sept 2006) and > move > on. > > Jason > > On 6/14/07, Bob wrote: > > > > require 'ezcrypto' > > > > key = EzCrypto::Key.new "1234567812345678", :algorithm=>"blowfish" > > key.encrypt_file "en.dll", "crypt.dll" > > key.decrypt_file "crypt.dll","en.dll" > > > > encrypts the 4,382,208 bytes file into a 29,003 bytes file decrypting > > this then obviously fails. This code works ok with small text files ok. > > > > Oh please don't RTFM me cos the documentation is up to the usual Ruby > > standard ;) > > Ruby, so much power so little documentation. > > > > Thanks for any help, > > Bob > > > > -- > > Posted via http://www.ruby-forum.com/. > > > > > ------=_Part_43608_21091189.1181836975830--