From: "Ara.T.Howard" Date: 2005-06-10T03:55:18+09:00 Subject: Re: How to take password from user On Fri, 10 Jun 2005, James Edward Gray II wrote: > On Jun 9, 2005, at 1:08 PM, Ara.T.Howard wrote: > >> On Fri, 10 Jun 2005, James Edward Gray II wrote: >> >> >>> #!/usr/local/bin/ruby -w >>> >>> require "rubygems" >>> require "highline/import" >>> >>> pass = ask("Enter your password: ") { |q| q.echo = false } # or q.echo = >>> "*" >>> puts "Your password is #{pass}!" >>> >>> __END__ >> >> does this clear out the password buffer in memory? > > Forgive me if I didn't understand your question completely, but I believe the > answer is basically yes. > > Behind the scenes, HighLine is using a cross platform character reader and > just accumulating the results in a local variable. It returns the contents > of that variable to you and then the scope is lost. > > I hope that's what you meant, but feel free to correct me if I just didn't > get the question. hmmm... it's probably still in memory for a while unless there is an explicit method to clear it. some password libs have this feature. thanks. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | My religion is very simple. My religion is kindness. | --Tenzin Gyatso ===============================================================================