From: Tod Beardsley Date: 2008-09-23T03:14:34+09:00 Subject: Re: how to manage passwords Hmm, that'd be quite the trick. Not even the professional-grade IM clients (Trillian and Pidgin) have figured out how to do that yet. :/ On Mon, Sep 22, 2008 at 9:58 AM, Junkone wrote: > On Sep 22, 12:00 am, Justin Collins wrote: >> Junkone wrote: >> > many of my ruby apps have the password hard coded. i am looking for a >> > way so that i can control the password not to be stored as text file. >> > what are the ruby options that are available. >> >> Do you need to know what the stored password is, or do you just need to >> validate passwords? >> >> If the latter, you can use the MD5, SHA1, or SHA2 libraries that come >> with Ruby: >> >> require 'digest/sha1' >> >> #Could load the hash from a file instead >> hash = Digest::SHA1.new.update("mypassword") >> >> print "Enter password: " >> input_password = gets.strip >> >> if hash == Digest::SHA1.new.update(input_password) >> puts "Access granted." >> else >> puts "Access denied." >> end >> >> -Justin > > i just store passwords in text files. i am looking for a secure way of > keeping these passwords and using it thro ruby as my progs need the > pass. > for eg. i send auto IM using bot and need my IM pass to be kept > secure. > > -- todb@planb-security.net | ICQ: 335082155 | Note: Due to Google's privacy policy and the United States' policy on electronic surveillance , please do not IM/e-mail me anything you wish to remain secret.