Announcement (2017-05-07): www.ruby-forum.com is now read-only since I
unfortunately do not have the time to support and maintain the forum any
more. Please see rubyonrails.org/community and ruby-lang.org/en/community
for other Rails- und Ruby-related community platforms.

I need to encrypt some items in the database in a rails app.
I tried using the old "sentry" gem, but it doesn't seem to be surviving
Rails 2. The stuff I found for Active Crypto on the web appeared to be
many years old.
What are folks using to encrypt db data via active record these days?
thanks,
jp

depends on what you are looking for. if want to have a one-way
function (for passwords and such) just try it like this:
encrypted_item = Digest::SHA256.hexdigest(“string_to_encrypt”)
you could also use SHA1, SHA384, SHA512 depending on your need of
security.

MaD wrote:
> depends on what you are looking for. if want to have a one-way> function (for passwords and such) just try it like this:>> encrypted_item = Digest::SHA256.hexdigest(ï¿½string_to_encryptï¿½)>> you could also use SHA1, SHA384, SHA512 depending on your need of> security.
Thanks, but I need to decrypt it also. It is "for your eyes only" user
data.
thanks,
jp

On Tue, Mar 10, 2009 at 10:15 AM, Jeff Pritchard <
rails-mailing-list@andreas-s.net> wrote:
> Thanks, but I need to decrypt it also. It is "for your eyes only" user> data.>> thanks,> jp>
There is a ruby-aes-normal gem. I have never used it. Have you looked
at?
Cheers--
Charles

Jeff Pritchard wrote:
> I need to encrypt some items in the database in a rails app.>> I tried using the old "sentry" gem, but it doesn't seem to be surviving> Rails 2. The stuff I found for Active Crypto on the web appeared to be> many years old.>> What are folks using to encrypt db data via active record these days?>> thanks,> jp
I'm starting to question the validity of this whole notion. It seems to
be expected that one would encrypt database tables that hold sensitive
information (like a user's health information for example).
Taking a step back from it though, what's the point? The database and
my app are all on the same server. Nobody can see the database files
unless they have access to my server. Anybody who does have access to
my server can look at the app to figure out how to read the encrypted
database tables/columns.
So what is the supposed advantage of encrypting them in the first
place????
Sorry for playing my own devil's advocate here, but it just dawned on me
that perhaps I was chasing a fool's errand. Please enlighten me.
thanks,
jp

2009/3/11 Jeff Pritchard <rails-mailing-list@andreas-s.net>
> > thanks,> database tables/columns.>> So what is the supposed advantage of encrypting them in the first> place????>
It may depend on the likelihood of someone leaving a CD backup copy of
the
database on a train (or a laptop with a copy of the db), and of how
embarrassing that would be.
If you are handling private personal information or commercially
confidential data you must consider the possibility of litigation if the
data escapes.
Colin

Colin Law wrote:
> 2009/3/11 Jeff Pritchard <rails-mailing-list@andreas-s.net>>>> > thanks,>> database tables/columns.>>>> So what is the supposed advantage of encrypting them in the first>> place????>>>> It may depend on the likelihood of someone leaving a CD backup copy of> the> database on a train (or a laptop with a copy of the db), and of how> embarrassing that would be.>> If you are handling private personal information or commercially> confidential data you must consider the possibility of litigation if the> data escapes.>> Colin
Thanks Colin. That sounds like a valid reason.
jp

Running the application usually involves some sort of user rights. If
the
passwords aren't stored on the server, then running the app won't give
access to the data. Just don't leave the keys in plain text on the
server
and don't leave user account info on the server.
One consideration: Encrypting in the app layer may become very painful
if
you want to do sql maintenance of your database.
Regards,
Nick
On Tue, Mar 10, 2009 at 11:05 PM, Jeff Pritchard <