From owner-freebsd-questions@FreeBSD.ORG Fri Feb 26 00:22:44 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D87F106564A for ; Fri, 26 Feb 2010 00:22:44 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout026.mac.com (asmtpout026.mac.com [17.148.16.101]) by mx1.freebsd.org (Postfix) with ESMTP id EC1C28FC08 for ; Fri, 26 Feb 2010 00:22:43 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from cswiger1.apple.com ([17.209.4.71]) by asmtp026.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KYF00CI0ADHGK50@asmtp026.mac.com> for freebsd-questions@freebsd.org; Thu, 25 Feb 2010 16:22:30 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-1002250245 From: Chuck Swiger In-reply-to: <20100219235957.GA94878@guilt.hydra> Date: Thu, 25 Feb 2010 16:22:29 -0800 Message-id: <8E22028B-1FF9-4750-8CD1-FA8ED669A156@mac.com> References: <20100219235957.GA94878@guilt.hydra> To: Chad Perrin X-Mailer: Apple Mail (2.1077) Cc: FreeBSD Questions Subject: Re: using secure memory from a script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 00:22:44 -0000 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