Skip to content

libsodium.SecureMemoryblock

Andrew Lambert edited this page Nov 26, 2022 · 16 revisions

libsodium.SecureMemoryblock

Class Declaration

 Protected Class SecureMemoryblock

Remarks

This class provides guarded heap memory allocations and memory protection. Guarded allocations are aligned on a page boundary and surrounded by canaries and guard pages, meaning any buffer overruns will immediately terminate the application. In addition, the memory can be marked as non-readable, non-writeable, and/or non-swapable.

This class should not be used for general-purpose memory allocations, but instead to protect sensitive data that has to be held in memory for extended periods of time. In general you should use this class if accidentally exposing the sensitive data is a worse outcome than having the OS forcibly terminate the whole application.

Methods

Properties

Clone this wiki locally