Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Feb 2010 16:22:29 -0800
From:      Chuck Swiger <cswiger@mac.com>
To:        Chad Perrin <perrin@apotheon.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: using secure memory from a script
Message-ID:  <8E22028B-1FF9-4750-8CD1-FA8ED669A156@mac.com>
In-Reply-To: <20100219235957.GA94878@guilt.hydra>
References:  <20100219235957.GA94878@guilt.hydra>

next in thread | previous in thread | raw e-mail | index | archive | help
On Feb 19, 2010, at 3:59 PM, Chad Perrin wrote:
> What's the simplest/easiest way to use "secure memory" (i.e., memory that
> won't be written to a swap partition) from within a program (written in
> Ruby in this case) on FreeBSD?

Well, Ruby supports calling C functions, so you can invoke mlock() that way:

  http://onlamp.com/pub/a/onlamp/2004/11/18/extending_ruby.html

...but you also have to do so as root.  It might be more sane to setup encrypted swapping:

  http://www.freebsd.org/doc/handbook/swap-encrypting.html

Regards,
-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8E22028B-1FF9-4750-8CD1-FA8ED669A156>