[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Crypto Lib for Ruby

ehaselsteiner

2/18/2005 3:19:00 PM

We did a really nice test tool in Ruby and I am really happy with the
language.

Now, we would have to add cryptographic functions to our tests. Basically
DES, AES, SHA-1, HMAC, and RSA. So, I looked for crypto libraries for
Ruby. The only thing I found was OpenSSL. But this seems to be not
documented and I found only people telling that it is not working. I was
also not able to find an openssl.rb file which I could use just out of the
box.

What is the status of this OpenSSL project ? The homepage looks kind of
not maintained.

Did I miss any alternatives ?

I also thought about using Java for the crypto stuff, but integrating Java
also seems quite tricky and not very clean. Did I miss anything here ?

Any help is appreciated

Best,
Ernst

Ernst Haselsteiner
Philips Austria
6 Answers

Roland Schmitt

2/18/2005 3:39:00 PM

0

Hi,

ehaselsteiner@gmx.at schrieb:
> We did a really nice test tool in Ruby and I am really happy with the
> language.
>
> Now, we would have to add cryptographic functions to our tests. Basically
> DES, AES, SHA-1, HMAC, and RSA. So, I looked for crypto libraries for
> Ruby. The only thing I found was OpenSSL. But this seems to be not
> documented and I found only people telling that it is not working. I was
> also not able to find an openssl.rb file which I could use just out of the
> box.
>

I think the openssl module is quite good enough for basic crypto
functions like the ones you have mentioned. I used them to extend the
soap4r module to communicate with ws-security web services on .NET
plattforms.

So the module works quite good, but the missing of documentation and
examples is still sad.

> What is the status of this OpenSSL project ? The homepage looks kind of
> not maintained.
>
> Did I miss any alternatives ?
No one, AFAIK.

>
> I also thought about using Java for the crypto stuff, but integrating Java
> also seems quite tricky and not very clean. Did I miss anything here ?
>
> Any help is appreciated
>
> Best,
> Ernst
>
> Ernst Haselsteiner
> Philips Austria
>
>

Regards,
Roland



Eric Hodel

2/18/2005 7:26:00 PM

0

On 18 Feb 2005, at 07:19, ehaselsteiner@gmx.at wrote:

> Now, we would have to add cryptographic functions to our tests.
> Basically
> DES, AES, SHA-1, HMAC, and RSA. So, I looked for crypto libraries for
> Ruby. The only thing I found was OpenSSL. But this seems to be not
> documented and I found only people telling that it is not working.

The OpenSSL command line tools are not documented either, which is
quite sad. OpenSSL seems to be the most complicated thing on the
planet.

> I was
> also not able to find an openssl.rb file which I could use just out of
> the
> box.

Its a .so (or .dll, or .bundle), not a .rb file.

> What is the status of this OpenSSL project ? The homepage looks kind of
> not maintained.

OpenSSL comes with Ruby now. No need to install other stuff.

> Did I miss any alternatives ?

I bet if there was a good alternative to OpenSSL, then more people
would use it. OpenSSL can be quite the beast, but it seems to do its
job once you figure out how to make it do that.

--
Eric Hodel - drbrain@segment7.net - http://se...
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Michael Neumann

2/18/2005 10:41:00 PM

0

ehaselsteiner@gmx.at wrote:
> We did a really nice test tool in Ruby and I am really happy with the
> language.
>
> Now, we would have to add cryptographic functions to our tests. Basically
> DES, AES, SHA-1, HMAC, and RSA. So, I looked for crypto libraries for
> Ruby. The only thing I found was OpenSSL. But this seems to be not
> documented and I found only people telling that it is not working. I was
> also not able to find an openssl.rb file which I could use just out of the
> box.
>
> What is the status of this OpenSSL project ? The homepage looks kind of
> not maintained.

Take this as a first start to find out more how to do the other
crypto-algorihtms:

require 'openssl'
def hmac(key, msg)
OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('md5'), key, msg) end

Hope this helps.

Regards,

Michael


ehaselsteiner

2/21/2005 10:51:00 AM

0

Hi All,

Thanks for your support :-)

I just figured out that OpenSSL does not come with Ruby (at least for me),
because I work on Windows. And the Windows release obviously does not
contain OpenSSL.

Do you have any further help for me on how to get OpenSSL running in Ruby
using Windows ?

>> require 'openssl'
>> def hmac(key, msg)
>> OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('md5'), key, msg)
end

This example is great !

I need to get it working under Windows.....

Best,
Ernst

gabriele renzi

2/21/2005 10:59:00 AM

0

ehaselsteiner@gmx.at ha scritto:
> Hi All,
>
> Thanks for your support :-)
>
> I just figured out that OpenSSL does not come with Ruby (at least for me),
> because I work on Windows. And the Windows release obviously does not
> contain OpenSSL.
>
> Do you have any further help for me on how to get OpenSSL running in Ruby
> using Windows ?

try using the stuff linked here:
http://www.garbagecollect.jp/ruby/mswin32/en/documents/in...

Roland Schmitt

2/21/2005 11:31:00 AM

0

Hi,

ehaselsteiner@gmx.at schrieb:
> Hi All,
>
> Thanks for your support :-)
>
> I just figured out that OpenSSL does not come with Ruby (at least for me),
> because I work on Windows. And the Windows release obviously does not
> contain OpenSSL.
>
> Do you have any further help for me on how to get OpenSSL running in Ruby
> using Windows ?

It is also in the package from
ftp://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ruby-1.8.2-i386-m...

Regards,
Roland