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 <junkone1 / gmail.com> wrote:
> On Sep 22, 12:00 am, Justin Collins <justincoll... / ucla.edu> 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 <http://tinyurl.com/5xbtl> and the United States'
policy on electronic surveillance <http://tinyurl.com/muuyl>,
please do not IM/e-mail me anything you wish to remain secret.