Crypto Lib for Ruby

E

ehaselsteiner

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
 
R

Roland Schmitt

Hi,

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
 
E

Eric Hodel

--Apple-Mail-10--548945941
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed

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 - (e-mail address removed) - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

--Apple-Mail-10--548945941
content-type: application/pgp-signature; x-mac-type=70674453;
name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFCFkFEMypVHHlsnwQRAuQWAJwJUA+iYY/AMlE6A4ESENzjHjLlmgCgjvLC
kFZaFpjJqeJwaRGMMtP3bRY=
=kp9y
-----END PGP SIGNATURE-----

--Apple-Mail-10--548945941--
 
M

Michael Neumann

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
 
E

ehaselsteiner

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 ?
end

This example is great !

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

Best,
Ernst
 
R

Roland Schmitt

Hi,

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-mswin32.zip

Regards,
Roland
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
anuragag27

Latest Threads

Top