securemem has a finalizeSecureMem [1] which is just a wrapper for finalizeForeignPtr, whichI think this is a good idea too. I don't think a scrubbing finalizer can give Erik the timing guarantees he wants (at least not without forcing a major collection by hand, and worrying about stray references), but it does seem likely to be a good thing to have around anyway. Note that for something like a password, you also have to be careful about things like input buffers. I imagine a hypothetical SecureByteString and/or SecureText would have to offer special IO as well.