[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

2 Way encryption for password

Gabriel Dragffy

9/2/2007 10:34:00 AM

Hi

I'm creating a password database (a dangerous thing to do, I know!)
normally I'd hash the passwords for storage in the DB, but in this
case I need to be able to also reverse them to their original state.
I'm familiar with the digest module, but of course it isn't of use
here. I didn't see anything obvious on my Google travels. Could
anyone suggest how to perform encryption in ruby, in particular based
on a rails application...?

Many thanks

Gabriel

4 Answers

Dan Zwell

9/2/2007 11:48:00 AM

0

Gabriel Dragffy wrote:
> Hi
>
> I'm creating a password database (a dangerous thing to do, I know!)
> normally I'd hash the passwords for storage in the DB, but in this case
> I need to be able to also reverse them to their original state. I'm
> familiar with the digest module, but of course it isn't of use here. I
> didn't see anything obvious on my Google travels. Could anyone suggest
> how to perform encryption in ruby, in particular based on a rails
> application...?
>
> Many thanks
>
> Gabriel
>
>

Have a look here:
http://stakeventures.com/articles/2005/06/16/cryp... (OpenSSL
contains many encryption algorithms), and you might want to browse this
list:
http://raa.ruby-lang.org/cat.rhtml?category_major=Library;category_minor=Cr...

Hope this helps,
Dan

Gabriel Dragffy

9/2/2007 4:39:00 PM

0


On 2 Sep 2007, at 12:47, Dan Zwell wrote:

> Gabriel Dragffy wrote:
>> Hi
>> I'm creating a password database (a dangerous thing to do, I
>> know!) normally I'd hash the passwords for storage in the DB, but
>> in this case I need to be able to also reverse them to their
>> original state. I'm familiar with the digest module, but of course
>> it isn't of use here. I didn't see anything obvious on my Google
>> travels. Could anyone suggest how to perform encryption in ruby,
>> in particular based on a rails application...?
>> Many thanks
>> Gabriel
>
> Have a look here: http://stakeventures.com/articles/2...
> crypto-in-ruby (OpenSSL contains many encryption algorithms), and
> you might want to browse this list: http://raa.ruby...
> cat.rhtml?category_major=Library;category_minor=Cryptography
>
> Hope this helps,
> Dan
>


Thank you very much, never thought of using the SSL library!

Regards

Gabe

Jeremy Hinegardner

9/2/2007 10:19:00 PM

0

On Sun, Sep 02, 2007 at 07:33:51PM +0900, Gabriel Dragffy wrote:
> Hi
>
> I'm creating a password database (a dangerous thing to do, I know!)
> normally I'd hash the passwords for storage in the DB, but in this
> case I need to be able to also reverse them to their original state.
> I'm familiar with the digest module, but of course it isn't of use
> here. I didn't see anything obvious on my Google travels. Could
> anyone suggest how to perform encryption in ruby, in particular based
> on a rails application...?

You might want to check out keybox and see if it would meet your needs.

http://keybox.ruby...

Its a pure ruby password database utilizing the SSL libraries for
encryption. It ships as a commandline application but it is fully
utilizable via its API.

If you have any questions, feel free to let me know.

enjoy,

-jeremy

--
========================================================================
Jeremy Hinegardner jeremy@hinegardner.org


Stefan Rusterholz

9/3/2007 5:33:00 AM

0

Gabriel Dragffy wrote:
> Hi
>
> I'm creating a password database (a dangerous thing to do, I know!)
> normally I'd hash the passwords for storage in the DB, but in this
> case I need to be able to also reverse them to their original state.
> I'm familiar with the digest module, but of course it isn't of use
> here. I didn't see anything obvious on my Google travels. Could
> anyone suggest how to perform encryption in ruby, in particular based
> on a rails application...?
>
> Many thanks
>
> Gabriel

Small nitpick about terminology: encryption is per definition 2 way,
what is often wrongly refered to as 1 way encryption is normally
cryptographic hashing (also see the note
http://en.wikipedia.org/wiki/One-way_...: "Note that encryption
is, by definition, reversible. Hence, the term one-way encryption is
slightly incorrect in a sense.")

Regards
Stefan
--
Posted via http://www.ruby-....