From: ruby rub Date: 2012-03-24T09:35:19+09:00 Subject: Write to kernel buffer? Is it possible to use Ruby to specifically write to the kernel buffer? I want to manage passwords securely. Here is what I have so far: require "io/console" require "stringio" loop do print "Please enter your passphrase:" @password = "" $stdin.noecho {$stdin.sysread(512, @password)} puts @password memstore = Thread.new { start = Time.now.to_i loop do if Time.now.to_i == (start + 2) then wipe = StringIO.new("\0" * @password.bytesize) wipe.read(@password.bytesize, @password) puts "password cleared" break end end } end It takes the password as input from the user, holds it in memory for some period of time, and then overwrites it. It also doesn't echo when the password is typed in. This is great but I also want to make sure the password is overwritten in the kernel buffer. Does anyone have any suggestions? Really I would just like to be pointed in the right direction :). -- Posted via http://www.ruby-forum.com/.