On Jan 21, 2008 1:05 PM, laredotornado / zipmail.com
<laredotornado / zipmail.com> wrote:
> Hi,
>
> I'm using the latest version of Ruby for Fedora Core 6 Linux.  I want
> to store credit card info in my database.  I'd like to store it in an
> encrypted form, but I'd also like to be able to decrypt it later.
> Does anyone have any useful encryption/decryption routines?
>

You can use the net/ssl standard library code to do this.  Here's a
blog post I found on this subject
http://blog.leetsoft.com/2006/03/14/simple-encryption

I just scored my first "googlewhack" when I tried to find this post
again right now, with the search "ruby openssl create_keys"
create_keys coming from the code in the rails app where I used this.

That said, one needs to be very careful in considering storing credit
card info, that private key is precious since if someone gets it and
the cc info get's leak, you might well be legally responsible.

In the site where I  used this, the public-facing machine has only a
public key which is used to encrypt the cc data in the database which
is running inside a company network accessible only through an ssh
connection, only the firewalled database server machine has the
private key.


-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/