This is a library of memory allocators and data structures to handle sensitive information, especially when interfacing with foreign and unsafe code.
It currently features:
- An interface to the system’s page allocator,
- a simple memory allocator implementing the
Allocator
trait, and - access‐guarded wrappers around
Box
,Vec
andString
.
Add this to your Cargo.toml
:
[dependencies]
sensitive = "0.10"
The force-mlock
feature may be used to force allocations to be memory‐resident: If the memory cannot be locked, the allocation will fail. Without this feature, locking is attempted, but failures are ignored.
This code relies heavily on experimental nightly‐only APIs.
This work is dedicated to the public domain under the terms of the CC0 1.0 licence.
The author holds no patent rights related to this work.