missingthepoint has asked for the wisdom of the Perl Monks concerning the following question:
Greetings, monks. :)
Assume I have some Perl code doing crypto stuff, which needs to hold a key in memory. When the code is finished doing it's thing, the key should be erased. In C, this is easy... I could just say
memset(sensitive_buf, 0, sizeof sensitive_buf);Done - as well as I can in software, anyway.
But what about Perl? If I wrote something like this:
$sensitive_1 = 0; $_ = 0 for @sensitive_2;
is that good enough? Or would it leak information, or generally not be as secure as I want?
Is this even a problem? Should I go about doing crypto from Perl some other way, like calling into a C library that erases keys itself? Am I missing anything?
- Eagerly awaiting your collective wisdom.
|
|---|