Encryption using ruby?

Hi all

I need to be able to encrypt/decrypt a small text file, but I'm struggling a
little finding an encryption library.

I found Jamis Buck's previous post about using openssl for encryption and
whilst it works, I can't make head nor tails of the openssl docs at
ruby-docs.org. I can't find any of the methods Jamis used in his code...
there only seem to be two of them for the cipher module.. ?
http://www.ruby-doc.org/stdlib/libdoc/openssl/rdoc/classes/OpenSSL/Cipher/Cipher.html

can anyone explain how the openssl library should be used please?

thanks
nick

Nick Hayworth wrote:

Hi all

I need to be able to encrypt/decrypt a small text file, but I'm struggling a little finding an encryption library.

See

http://ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/144861

for a pure-Ruby encryption lib.

James

···

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys

Just posted a really quick small example of doing AES encryption using openssl :

Pelle

···

On 6/13/05, Nick Hayworth <chipped_up@hotmail.com> wrote:

Hi all

I need to be able to encrypt/decrypt a small text file, but I'm struggling a
little finding an encryption library.

I found Jamis Buck's previous post about using openssl for encryption and
whilst it works, I can't make head nor tails of the openssl docs at
ruby-docs.org. I can't find any of the methods Jamis used in his code...
there only seem to be two of them for the cipher module.. ?
http://www.ruby-doc.org/stdlib/libdoc/openssl/rdoc/classes/OpenSSL/Cipher/Cipher.html

can anyone explain how the openssl library should be used please?

thanks
nick

--
https://stakeitout.com + Stake out your own micro ventures
http://neubia.com + Geek blog
http://stakeventures.com + Bootstrapping blog
http://SoapBX.com + Get on the box and shout

It took me some time to figure it out myself. Ive got a small wrapper
library that I use to simplify my life. When I get home I will post a
blog entry with it and how it works.

For my new project https://stakeitout.com (blatant plug alert), I am
doing alot of crypto using the OpenSSL libraries.

I will submit most of this and my encrypting ActiveRecord wrapper to
rails in a few weeks time, when I have time to clean it up a bit.

Pelle

···

On 6/13/05, James Britt <james_b@neurogami.com> wrote:

Nick Hayworth wrote:
> Hi all
>
> I need to be able to encrypt/decrypt a small text file, but I'm struggling a
> little finding an encryption library.

See

http://ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/144861

for a pure-Ruby encryption lib.

James

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys

--
https://stakeitout.com + Stake out your own micro ventures
http://neubia.com + Geek blog
http://stakeventures.com + Bootstrapping blog
http://SoapBX.com + Get on the box and shout