On 9/30/06, Jorge Almeida <[EMAIL PROTECTED]> wrote:

Is there some way to keep a string in RAM, not allowing it to go to
swap? Just like gnupg does with passphrases, and for similar reasons.
(Linux only, no portability required!)

Not in pure Perl. And extensions don't help much: You could write a
simple extension that keeps a string for you, but how will you get the
data into it (and out again) without potentially leaking data that
will show up in swapfiles or coredumps?

One idea (which may not work for your application) might be that the
Perl code wouldn't know the passphrase, but only some data derived by
a one-way hash function from the passphrase. An extension would ask
the user for the passphrase and return the result of the hash
function.

There are some modules on CPAN that may do something similar to that.
Maybe something there can help you:

   http://search.cpan.org/search?query=passphrase&mode=all

Good luck with it!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to